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_revoke_invite_02_filetest.gno

0.86 Kb · 36 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_revoke_invite_02_filetest
 2
 3package z_revoke_invite_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 = "g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5"
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	testing.SetRealm(testing.NewUserRealm(user))
25	boards2.RequestInvite(cross(cur), bid)
26}
27
28func main(cur realm) {
29	// Caller is not a member and has no permission to revoke invites
30	testing.SetRealm(testing.NewUserRealm(user))
31
32	boards2.RevokeInvite(cross(cur), bid, user)
33}
34
35// Error:
36// unauthorized, user g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5 doesn't have the required permission