// PKGPATH: gno.land/p/archive/groups_test package groups_test // SEND: 1000000ugnot import ( "chain/runtime" "testing" "gno.land/p/nt/testutils/v0" "gno.land/r/archive/groups" uinit "gno.land/r/sys/users/init" ) var gid groups.GroupID const admin = address("g1manfred47kzduec920z88wfr64ylksmdcedlf5") func main() { caller := runtime.OriginCaller() // main testing.SetRealm(testing.NewUserRealm(caller)) uinit.RegisterUser(cross, "main123", caller) test1 := testutils.TestAddress("gnouser1") testing.SetOriginCaller(test1) testing.SetRealm(testing.NewUserRealm(test1)) uinit.RegisterUser(cross, "test123", test1) test2 := testutils.TestAddress("gnouser2") testing.SetOriginCaller(test2) testing.SetRealm(testing.NewUserRealm(test2)) uinit.RegisterUser(cross, "test223", test2) test3 := testutils.TestAddress("gnouser3") testing.SetOriginCaller(test3) testing.SetRealm(testing.NewUserRealm(test3)) uinit.RegisterUser(cross, "test323", test3) testing.SetOriginCaller(caller) testing.SetRealm(testing.NewUserRealm(caller)) gid = groups.CreateGroup(cross, "test_group") println(gid) groups.AddMember(cross, gid, test3.String(), 32, "i am from UAE") println(groups.Render("test_group")) } // Output: // 1 // Group ID: 0000000001 // // Group Name: test_group // // Group Creator: main123 // // Group createdAt: 2009-02-13 23:31:30 +0000 UTC // // Group Last MemberID: 0000000001 // // Group Members: // // [0000000000, g1vahx7atnv4erxh6lta047h6lta047h6ll85gpy, 32, i am from UAE, 2009-02-13 23:31:30 +0000 UTC],