Search Apps Documentation Source Content File Folder Download Copy

z_11_filetest.gno

0.45 Kb ยท 25 lines
 1package main
 2
 3// SEND: 200000000ugnot
 4
 5import (
 6	"std"
 7
 8	"gno.land/r/demo/users"
 9)
10
11const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")
12
13func main() {
14	caller := std.GetOrigCaller() // main
15	std.TestSetOrigCaller(admin)
16	users.AdminAddRestrictedName("superrestricted")
17
18	// test restricted name
19	std.TestSetOrigCaller(caller)
20	users.Register("", "superrestricted", "my profile")
21	println("done")
22}
23
24// Error:
25// restricted name: superrestricted