Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_is_member_01_filetest.gno

0.57 Kb · 27 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/gnoland/boards/v0"
 7
 8	boards2 "gno.land/r/gnoland/boards2/v0"
 9)
10
11const (
12	owner address = "g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"
13	user  address = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // @test2
14	bid           = boards.ID(0)                               // Operate on realm DAO instead of individual boards
15	role          = boards2.RoleGuest
16)
17
18func main() {
19	testing.SetRealm(testing.NewUserRealm(owner))
20
21	println(boards2.HasMemberRole(bid, user, role))
22	println(boards2.IsMember(bid, user))
23}
24
25// Output:
26// false
27// false