z_set_flagging_threshold_00_filetest.gno
0.67 Kb · 32 lines
1// PKGPATH: gno.land/r/gnoland/boards2/v1/filetests/z_set_flagging_threshold_00_filetest
2
3package z_set_flagging_threshold_00_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 bid boards.ID
16
17func init(cur realm) {
18 testing.SetRealm(testing.NewUserRealm(owner))
19 bid = boards2.CreateBoard(cross(cur), "test-board", false, false)
20}
21
22func main(cur realm) {
23 testing.SetRealm(testing.NewUserRealm(owner))
24
25 boards2.SetFlaggingThreshold(cross(cur), bid, 4)
26
27 // Ensure that flagging threshold changed
28 println(boards2.GetFlaggingThreshold(bid))
29}
30
31// Output:
32// 4