overide_filetest.gno

0.46 Kb ยท 24 lines
 1package main
 2
 3import (
 4	"std"
 5
 6	"gno.land/p/demo/testutils"
 7	"gno.land/r/gnoland/home"
 8)
 9
10func main() {
11	std.TestSetOrigCaller("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
12	home.AdminSetOverride("Hello World!")
13	println(home.Render(""))
14	home.AdminTransferOwnership(testutils.TestAddress("newAdmin"))
15	defer func() {
16		r := recover()
17		println("r: ", r)
18	}()
19	home.AdminSetOverride("Not admin anymore")
20}
21
22// Output:
23// Hello World!
24// r:  ownable: caller is not owner