Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_4_c_filetest.gno

0.77 Kb ยท 34 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/gnoland/boards"
 7
 8	boards2 "gno.land/r/boards000/v1rc1"
 9)
10
11const (
12	owner  address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13	owner2 address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // @test2
14	admin  address = "g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5"
15)
16
17var bid boards.ID // Operate on board DAO
18
19func init() {
20	testing.SetRealm(testing.NewUserRealm(owner))
21	bid = boards2.CreateBoard(cross, "test123", false)
22
23	boards2.InviteMember(cross, bid, owner2, boards2.RoleOwner)
24	boards2.InviteMember(cross, bid, admin, boards2.RoleAdmin)
25}
26
27func main() {
28	testing.SetRealm(testing.NewUserRealm(admin))
29
30	boards2.ChangeMemberRole(cross, bid, owner2, boards2.RoleAdmin)
31}
32
33// Error:
34// admins are not allowed to remove the Owner role