z_24_b_filetest.gno

0.57 Kb ยท 31 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	boards2 "gno.land/r/gnoland/boards2/v1"
 7)
 8
 9const (
10	owner = address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
11	admin = address("g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5")
12)
13
14var bid boards2.BoardID
15
16func init() {
17	testing.SetRealm(testing.NewUserRealm(owner))
18
19	bid = boards2.CreateBoard(cross, "test123", false)
20	boards2.InviteMember(cross, bid, admin, boards2.RoleAdmin)
21}
22
23func main() {
24	testing.SetRealm(testing.NewUserRealm(admin))
25
26	// Calling as a non owner member should fail
27	boards2.GetBoard(bid)
28}
29
30// Error:
31// forbidden