z_1_b_filetest.gno
0.83 Kb ยท 36 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/gnoland/boards"
7
8 boards2 "gno.land/r/gnoland/boards2/v1"
9 "gno.land/r/gnoland/boards2/v1/permissions"
10)
11
12const (
13 owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
14 admin address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // @test2
15 user address = "g1w4ek2u33ta047h6lta047h6lta047h6ldvdwpn"
16)
17
18var bid boards.ID // Operate on board DAO
19
20func init() {
21 testing.SetRealm(testing.NewUserRealm(owner))
22 bid = boards2.CreateBoard(cross, "test123", false, false)
23
24 // Add an admin member
25 boards2.InviteMember(cross, bid, admin, permissions.RoleAdmin)
26}
27
28func main() {
29 // Next call will be done by the admin member
30 testing.SetRealm(testing.NewUserRealm(admin))
31
32 boards2.InviteMember(cross, bid, user, permissions.RoleOwner)
33}
34
35// Error:
36// only owners are allowed to invite other owners