diff --git a/examples/gno.land/p/demo/ownable/ownable.gno b/examples/gno.land/p/demo/ownable/ownable.gno index 55c85cfa73d..5a5f624bc95 100644 --- a/examples/gno.land/p/demo/ownable/ownable.gno +++ b/examples/gno.land/p/demo/ownable/ownable.gno @@ -13,7 +13,7 @@ type Ownable struct { func New() *Ownable { return &Ownable{ - owner: std.CurrentRealm().Address(), + owner: std.PreviousRealm().Address(), } } diff --git a/examples/gno.land/p/demo/ownable/ownable_test.gno b/examples/gno.land/p/demo/ownable/ownable_test.gno index f37ae4f41fd..e1d7dc1b8e9 100644 --- a/examples/gno.land/p/demo/ownable/ownable_test.gno +++ b/examples/gno.land/p/demo/ownable/ownable_test.gno @@ -15,6 +15,7 @@ var ( ) func TestNew(t *testing.T) { + testing.SetRealm(std.NewCodeRealm("gno.land/r/test/test")) testing.SetOriginCaller(alice) o := New() @@ -30,6 +31,7 @@ func TestNewWithAddress(t *testing.T) { } func TestTransferOwnership(t *testing.T) { + testing.SetRealm(std.NewCodeRealm("gno.land/r/test/test")) testing.SetOriginCaller(alice) o := New() @@ -68,6 +70,7 @@ func TestDropOwnership(t *testing.T) { // Errors func TestErrUnauthorized(t *testing.T) { + testing.SetRealm(std.NewCodeRealm("gno.land/r/test/test")) testing.SetOriginCaller(alice) o := New() @@ -79,6 +82,7 @@ func TestErrUnauthorized(t *testing.T) { } func TestErrInvalidAddress(t *testing.T) { + testing.SetRealm(std.NewCodeRealm("gno.land/r/test/test")) testing.SetOriginCaller(alice) o := New()