Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_3_a_filetest.gno

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