Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Nov 16, 2024
1 parent 6435ef0 commit 9ff36e0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
22 changes: 15 additions & 7 deletions examples/gno.land/r/demo/tests/crossrealm/crossrealm.gno
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@ func SetFooer(f Fooer) Fooer {
fooer = f
return fooer
}
func CallFoo() { fooer.Foo() }

func FooerGetter() Fooer {
return fooer
func GetFooer() Fooer { return fooer }

func CallFooerFoo() { fooer.Foo() }

type FooerGetter func() Fooer

var fooerGetter FooerGetter

func SetFooerGetter(fg FooerGetter) FooerGetter {
fooerGetter = fg
return fg
}

func FooerGetterBuilder() func() Fooer {
return func() Fooer {
return fooer
}
func GetFooerGetter() FooerGetter {
return fooerGetter
}

func CallFooerGetterFoo() { fooerGetter().Foo() }
2 changes: 1 addition & 1 deletion gnovm/tests/files/zrealm_crossrealm15.gno
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ func main() {
}

// Error:
// new escaped mark has no object ID
// gno.land/r/crossrealm_test/main.gno:19:2: name CallFoo not declared
2 changes: 1 addition & 1 deletion gnovm/tests/files/zrealm_crossrealm16.gno
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ func main() {
}

// Error:
// new escaped mark has no object ID
// gno.land/r/crossrealm_test/main.gno:19:2: name CallFoo not declared
2 changes: 1 addition & 1 deletion gnovm/tests/files/zrealm_crossrealm17.gno
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ func main() {
}

// Error:
// new escaped mark has no object ID
// gno.land/r/crossrealm_test/main.gno:22:2: name CallFoo not declared
4 changes: 2 additions & 2 deletions gnovm/tests/files/zrealm_crossrealm18.gno
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ func (fooer) Foo() { println("hello " + std.CurrentRealm().PkgPath()) }
var f crossrealm.Fooer = crossrealm.SetFooer(&fooer{})

func init() {
crossrealm.CallFoo()
crossrealm.CallFooerFoo()
}

func main() {
crossrealm.CallFoo()
crossrealm.CallFooerFoo()
print(".")
}

Expand Down
2 changes: 1 addition & 1 deletion gnovm/tests/files/zrealm_crossrealm19_stdlibs.gno
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var f *fooer
func init() {
f = &fooer{s: "A"}
crossrealm.SetFooer(f)
crossrealm.CallFoo()
crossrealm.CallFooerFoo()
}

func main() {
Expand Down

0 comments on commit 9ff36e0

Please sign in to comment.