Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_create_thread_02_filetest.gno

0.73 Kb · 32 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_create_thread_02_filetest
 2
 3package z_create_thread_02_filetest
 4
 5import (
 6	"testing"
 7
 8	"gno.land/p/gnoland/boards/v0"
 9
10	boards2 "gno.land/r/gnoland/boards2/v0"
11)
12
13const (
14	owner address = "g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"
15	user  address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // @test2
16)
17
18var bid boards.ID
19
20func init(cur realm) {
21	testing.SetRealm(testing.NewUserRealm(owner))
22	bid = boards2.CreateBoard(cross(cur), "test123", false, false)
23}
24
25func main(cur realm) {
26	testing.SetRealm(testing.NewUserRealm(user))
27
28	boards2.CreateThread(cross(cur), bid, "Foo", "bar")
29}
30
31// Error:
32// unauthorized, user g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj doesn't have the required permission