Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_2_d_filetest.gno

0.68 Kb · 35 lines
 1// PKGPATH: gno.land/p/archive/groups_test
 2package groups_test
 3
 4// SEND: 200000000ugnot
 5
 6import (
 7	"chain"
 8	"testing"
 9
10	"gno.land/p/nt/testutils/v0"
11	"gno.land/r/archive/groups"
12	uinit "gno.land/r/sys/users/init"
13)
14
15var gid groups.GroupID
16
17func main() {
18	uinit.RegisterUser(cross, "gnouser123", address("g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm"))
19	gid = groups.CreateGroup(cross, "test_group")
20	println(gid)
21
22	// delete member via anon user
23	test2 := testutils.TestAddress("test2")
24	testing.SetOriginCaller(test2)
25	testing.SetOriginSend(chain.Coins{{"ugnot", 9000000}})
26
27	groups.DeleteMember(cross, gid, 0)
28	println(groups.Render(""))
29}
30
31// Output:
32// 1
33
34// Error:
35// unauthorized to delete member