z_2_e_filetest.gno
0.62 Kb ยท 32 lines
1package main
2
3import (
4 "testing"
5
6 boards2 "gno.land/r/gnoland/boards2/v1"
7)
8
9const owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
10
11var (
12 bid boards2.BoardID
13 tid boards2.PostID
14)
15
16func init() {
17 testing.SetRealm(testing.NewUserRealm(owner))
18 bid = boards2.CreateBoard(cross, "test123", false)
19 tid = boards2.CreateThread(cross, bid, "Foo", "bar")
20
21 // Hide thread by flagging it so reply can't be submitted
22 boards2.FlagThread(cross, bid, tid, "reason")
23}
24
25func main() {
26 testing.SetRealm(testing.NewUserRealm(owner))
27
28 boards2.CreateReply(cross, bid, tid, 0, "Test reply")
29}
30
31// Error:
32// thread is hidden