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