From 9ff36e06d77b17a4fe53ca1ee8ab85482e76b46c Mon Sep 17 00:00:00 2001 From: moul <94029+moul@users.noreply.github.com> Date: Sat, 16 Nov 2024 09:57:24 +0100 Subject: [PATCH] chore: fixup Signed-off-by: moul <94029+moul@users.noreply.github.com> --- .../r/demo/tests/crossrealm/crossrealm.gno | 22 +++++++++++++------ gnovm/tests/files/zrealm_crossrealm15.gno | 2 +- gnovm/tests/files/zrealm_crossrealm16.gno | 2 +- gnovm/tests/files/zrealm_crossrealm17.gno | 2 +- gnovm/tests/files/zrealm_crossrealm18.gno | 4 ++-- .../files/zrealm_crossrealm19_stdlibs.gno | 2 +- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/examples/gno.land/r/demo/tests/crossrealm/crossrealm.gno b/examples/gno.land/r/demo/tests/crossrealm/crossrealm.gno index c0a52eb1d4a..1cc5a3f8e18 100644 --- a/examples/gno.land/r/demo/tests/crossrealm/crossrealm.gno +++ b/examples/gno.land/r/demo/tests/crossrealm/crossrealm.gno @@ -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() } diff --git a/gnovm/tests/files/zrealm_crossrealm15.gno b/gnovm/tests/files/zrealm_crossrealm15.gno index 4aaf3a2c44a..9006310c8f0 100644 --- a/gnovm/tests/files/zrealm_crossrealm15.gno +++ b/gnovm/tests/files/zrealm_crossrealm15.gno @@ -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 diff --git a/gnovm/tests/files/zrealm_crossrealm16.gno b/gnovm/tests/files/zrealm_crossrealm16.gno index ffae24f638d..21d7e78ce01 100644 --- a/gnovm/tests/files/zrealm_crossrealm16.gno +++ b/gnovm/tests/files/zrealm_crossrealm16.gno @@ -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 diff --git a/gnovm/tests/files/zrealm_crossrealm17.gno b/gnovm/tests/files/zrealm_crossrealm17.gno index 19abb6c0cc5..46c6eeb5061 100644 --- a/gnovm/tests/files/zrealm_crossrealm17.gno +++ b/gnovm/tests/files/zrealm_crossrealm17.gno @@ -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 diff --git a/gnovm/tests/files/zrealm_crossrealm18.gno b/gnovm/tests/files/zrealm_crossrealm18.gno index cc46e3df514..f7a318ed3a0 100644 --- a/gnovm/tests/files/zrealm_crossrealm18.gno +++ b/gnovm/tests/files/zrealm_crossrealm18.gno @@ -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(".") } diff --git a/gnovm/tests/files/zrealm_crossrealm19_stdlibs.gno b/gnovm/tests/files/zrealm_crossrealm19_stdlibs.gno index fa12c282ea4..a3b864755fd 100644 --- a/gnovm/tests/files/zrealm_crossrealm19_stdlibs.gno +++ b/gnovm/tests/files/zrealm_crossrealm19_stdlibs.gno @@ -21,7 +21,7 @@ var f *fooer func init() { f = &fooer{s: "A"} crossrealm.SetFooer(f) - crossrealm.CallFoo() + crossrealm.CallFooerFoo() } func main() {