Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/gno.land/p/demo/ownable/ownable.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Ownable struct {

func New() *Ownable {
return &Ownable{
owner: std.CurrentRealm().Address(),
owner: std.PreviousRealm().Address(),
}
}

Expand Down
4 changes: 4 additions & 0 deletions examples/gno.land/p/demo/ownable/ownable_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var (
)

func TestNew(t *testing.T) {
testing.SetRealm(std.NewCodeRealm("gno.land/r/test/test"))
testing.SetOriginCaller(alice)

o := New()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
Loading