z_20_a_filetest.gno

0.66 Kb ยท 35 lines
 1package main
 2
 3import (
 4	"std"
 5	"testing"
 6
 7	boards2 "gno.land/r/gnoland/boards2/v1"
 8)
 9
10const owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
11
12var (
13	bid boards2.BoardID
14	tid boards2.PostID
15	rid boards2.PostID
16)
17
18func init() {
19	testing.SetRealm(std.NewUserRealm(owner))
20	bid = boards2.CreateBoard(cross, "test123", false)
21	tid = boards2.CreateThread(cross, bid, "foo", "bar")
22	rid = boards2.CreateReply(cross, bid, tid, 0, "reply")
23
24	boards2.FreezeThread(cross, bid, tid)
25}
26
27func main() {
28	testing.SetRealm(std.NewUserRealm(owner))
29
30	// Attempt to freeze a reply on frozen thread
31	boards2.FreezeReply(cross, bid, tid, rid)
32}
33
34// Error:
35// thread is frozen