Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_create_reply_06_filetest.gno

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