Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_create_board_04_filetest.gno

0.70 Kb · 28 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/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/v0"
 9	uinit "gno.land/r/sys/users/init"
10)
11
12const owner address = "g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"
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