z_2_g_filetest.gno
0.73 Kb ยท 33 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, rid 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, "thread", "thread")
20 rid = boards2.CreateReply(cross, bid, tid, 0, "reply1")
21
22 // Hide reply by flagging it so sub reply can't be submitted
23 boards2.FlagReply(cross, bid, tid, rid, "reason")
24}
25
26func main() {
27 testing.SetRealm(testing.NewUserRealm(owner))
28
29 boards2.CreateReply(cross, bid, tid, rid, "reply1.1")
30}
31
32// Error:
33// replying to a hidden or frozen reply is not allowed