z_2_g_filetest.gno
0.74 Kb ยท 35 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/gnoland/boards"
7
8 boards2 "gno.land/r/boards000/v1rc1"
9)
10
11const owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
12
13var (
14 bid boards.ID
15 tid, rid boards.ID
16)
17
18func init() {
19 testing.SetRealm(testing.NewUserRealm(owner))
20 bid = boards2.CreateBoard(cross, "test123", false)
21 tid = boards2.CreateThread(cross, bid, "thread", "thread")
22 rid = boards2.CreateReply(cross, bid, tid, 0, "reply1")
23
24 // Hide reply by flagging it so sub reply can't be submitted
25 boards2.FlagReply(cross, bid, tid, rid, "reason")
26}
27
28func main() {
29 testing.SetRealm(testing.NewUserRealm(owner))
30
31 boards2.CreateReply(cross, bid, tid, rid, "reply1.1")
32}
33
34// Error:
35// replying to a hidden or frozen reply is not allowed