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("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
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