z_1_b_filetest.gno
0.77 Kb ยท 34 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 admin = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2
13 user = std.Address("g1w4ek2u33ta047h6lta047h6lta047h6ldvdwpn")
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 // Add an admin member
23 boards2.InviteMember(cross, bid, admin, boards2.RoleAdmin)
24}
25
26func main() {
27 // Next call will be done by the admin member
28 testing.SetRealm(std.NewUserRealm(admin))
29
30 boards2.InviteMember(cross, bid, user, boards2.RoleOwner)
31}
32
33// Error:
34// only owners are allowed to invite other owners