Search Apps Documentation Source Content File Folder Download Copy Actions Download

override_filetest.gno

0.57 Kb ยท 28 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/nt/testutils"
 7	"gno.land/r/gnoland/home"
 8)
 9
10func main() {
11	var admin = address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")
12	testing.SetOriginCaller(admin)
13	home.AdminSetOverride(cross, "Hello World!")
14	println("---")
15	println(home.Render(""))
16
17	newAdmin := testutils.TestAddress("newAdmin")
18	home.Admin.TransferOwnership(newAdmin)
19	if err := revive(func() {
20		home.AdminSetOverride(cross, "Not admin anymore")
21	}); err == nil {
22		panic("AdminSetOverride should have aborted the transaction")
23	}
24}
25
26// Output:
27// ---
28// Hello World!