Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_create_board_04_filetest.gno

0.70 Kb · 28 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v1/filetests/z_create_board_04_filetest
 2
 3package z_create_board_04_filetest
 4
 5import (
 6	"testing"
 7
 8	boards2 "gno.land/r/gnoland/boards2/v1"
 9	uinit "gno.land/r/sys/users/init"
10)
11
12const owner address = "g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"
13
14func init(cur realm) {
15	// uinit.RegisterUser is genesis-only since the security fix.
16	testing.SetHeight(0)
17	uinit.RegisterUser(cross(cur), "gnoland", address("g1g3lsfxhvaqgdv4ccemwpnms4fv6t3aq3p5z6u7"))
18	testing.SetHeight(123)
19}
20
21func main(cur realm) {
22	testing.SetRealm(testing.NewUserRealm(owner))
23
24	boards2.CreateBoard(cross(cur), "gnoland", false, false)
25}
26
27// Error:
28// board name is a user name registered to a different user