z_20_a_filetest.gno
0.66 Kb ยท 34 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 rid boards2.PostID
15)
16
17func init() {
18 testing.SetRealm(testing.NewUserRealm(owner))
19 bid = boards2.CreateBoard(cross, "test123", false)
20 tid = boards2.CreateThread(cross, bid, "foo", "bar")
21 rid = boards2.CreateReply(cross, bid, tid, 0, "reply")
22
23 boards2.FreezeThread(cross, bid, tid)
24}
25
26func main() {
27 testing.SetRealm(testing.NewUserRealm(owner))
28
29 // Attempt to freeze a reply on frozen thread
30 boards2.FreezeReply(cross, bid, tid, rid)
31}
32
33// Error:
34// thread is frozen