z_2_d_filetest.gno

0.57 Kb ยท 31 lines
 1// PKGPATH: gno.land/r/demo/groups_test
 2package groups_test
 3
 4// SEND: 200000000ugnot
 5
 6import (
 7	"std"
 8
 9	"gno.land/p/demo/testutils"
10	"gno.land/r/demo/groups"
11	"gno.land/r/demo/users"
12)
13
14var gid groups.GroupID
15
16func main() {
17	users.Register("", "gnouser", "my profile")
18	gid = groups.CreateGroup("test_group")
19	println(gid)
20
21	// delete member via anon user
22	test2 := testutils.TestAddress("test2")
23	std.TestSetOrigCaller(test2)
24	std.TestSetOrigSend(std.Coins{{"ugnot", 9000000}}, nil)
25
26	groups.DeleteMember(gid, 0)
27	println(groups.Render(""))
28}
29
30// Error:
31// unauthorized to delete member