z_3_a_filetest.gno
0.64 Kb ยท 34 lines
1package main
2
3import (
4 "std"
5 "testing"
6
7 boards2 "gno.land/r/gnoland/boards2/v1"
8)
9
10const (
11 owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
12 name = "foo123"
13 newName = "bar123"
14)
15
16var bid boards2.BoardID // Operate on board DAO
17
18func init() {
19 testing.SetRealm(std.NewUserRealm(owner))
20 bid = boards2.CreateBoard(cross, name, false)
21}
22
23func main() {
24 testing.SetRealm(std.NewUserRealm(owner))
25
26 boards2.RenameBoard(cross, name, newName)
27
28 // Ensure board is renamed by the default board owner
29 bid2, _ := boards2.GetBoardIDFromName(cross, newName)
30 println("IDs match =", bid == bid2)
31}
32
33// Output:
34// IDs match = true