package main // SEND: 1000000ugnot import ( "std" "testing" boards2 "gno.land/r/gnoland/boards2/v1" users "gno.land/r/gnoland/users/v1" ) const ( owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx member = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2 name = "foo123" newName = "barbaz123" ) var bid boards2.BoardID // Operate on board DAO func init() { testing.SetRealm(std.NewUserRealm(owner)) bid = boards2.CreateBoard(cross, name, false) boards2.InviteMember(cross, bid, member, boards2.RoleOwner) // Test1 is the boards owner and its address has a user already registered // so a new member must register a user with the new board name. testing.SetRealm(std.NewUserRealm(member)) users.Register(cross, newName) } func main() { testing.SetRealm(std.NewUserRealm(member)) boards2.RenameBoard(cross, name, newName) // Ensure board is renamed by another board owner bid2, _ := boards2.GetBoardIDFromName(cross, newName) println("IDs match =", bid == bid2) } // Output: // IDs match = true