z_4_d_filetest.gno

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