z_4_c_filetest.gno
0.77 Kb ยท 33 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 owner2 = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2
13 admin = std.Address("g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5")
14)
15
16var bid boards2.BoardID // Operate on board DAO
17
18func init() {
19 testing.SetRealm(std.NewUserRealm(owner))
20 bid = boards2.CreateBoard(cross, "test123", false)
21
22 boards2.InviteMember(cross, bid, owner2, boards2.RoleOwner)
23 boards2.InviteMember(cross, bid, admin, boards2.RoleAdmin)
24}
25
26func main() {
27 testing.SetRealm(std.NewUserRealm(admin))
28
29 boards2.ChangeMemberRole(cross, bid, owner2, boards2.RoleAdmin)
30}
31
32// Error:
33// admins are not allowed to remove the Owner role