From 0cca8f82b9f4cf440dbf2e3f6e30c580736484cb Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Wed, 19 Apr 2023 20:10:40 +0200 Subject: [PATCH 1/3] chore: add contracts to test advanced frames/stacks patterns Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno | 0 .../gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno | 0 .../gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno | 0 .../r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno | 0 .../r/demo/x/caller_patterns/e_another_utility_lib/contract.gno | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno create mode 100644 examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno create mode 100644 examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno create mode 100644 examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno create mode 100644 examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno diff --git a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno new file mode 100644 index 00000000000..e69de29bb2d diff --git a/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno new file mode 100644 index 00000000000..e69de29bb2d diff --git a/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno new file mode 100644 index 00000000000..e69de29bb2d diff --git a/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno new file mode 100644 index 00000000000..e69de29bb2d diff --git a/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno new file mode 100644 index 00000000000..e69de29bb2d From ef8b4982e6214b01d7adb26a179f76234a2dbb23 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Wed, 19 Apr 2023 20:15:51 +0200 Subject: [PATCH 2/3] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../r/demo/x/caller_patterns/a_token_lib/contract.gno | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno index e69de29bb2d..d9da4f02033 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno @@ -0,0 +1,11 @@ +package token_lib + +import "std" + +func TestGetCaller() { + println("token_lib.TestGetCaller=", std.GetCaller()) +} + +func TestGetOrigCaller() { + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +} \ No newline at end of file From a1727ff502b841fabcce00618bc8e2ea3b2a5c68 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Mon, 24 Apr 2023 17:08:36 +0200 Subject: [PATCH 3/3] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../x/caller_patterns/a_token_lib/contract.gno | 8 ++++---- .../caller_patterns/a_token_lib/contract_test.gno | 14 ++++++++++++++ .../x/caller_patterns/b_token_realm/contract.gno | 11 +++++++++++ .../x/caller_patterns/c_utility_lib/contract.gno | 11 +++++++++++ .../d_vault_or_multisig/contract.gno | 11 +++++++++++ .../e_another_utility_lib/contract.gno | 11 +++++++++++ 6 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract_test.gno diff --git a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno index d9da4f02033..0ddb332289d 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract.gno @@ -1,11 +1,11 @@ package token_lib import "std" - + func TestGetCaller() { - println("token_lib.TestGetCaller=", std.GetCaller()) + //println("token_lib.TestGetCaller=", std.GetCaller()) } func TestGetOrigCaller() { - println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) -} \ No newline at end of file + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +} diff --git a/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract_test.gno b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract_test.gno new file mode 100644 index 00000000000..62fb29461aa --- /dev/null +++ b/examples/gno.land/r/demo/x/caller_patterns/a_token_lib/contract_test.gno @@ -0,0 +1,14 @@ +package token_lib + +import ( + "std" + "testing" + + "gno.land/p/demo/testutils" +) + +func Test(t testing.T) { + std.TestSetOrigCaller(testutils.TestAddress("foobar")) + // GetCaller() + GetOrigCaller() +} diff --git a/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno index e69de29bb2d..4bb7e18babe 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/b_token_realm/contract.gno @@ -0,0 +1,11 @@ +package token_lib + +import "std" + +func TestGetCaller() { + println("token_lib.TestGetCaller=", std.GetCaller()) +} + +func TestGetOrigCaller() { + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +} diff --git a/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno index e69de29bb2d..4bb7e18babe 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/c_utility_lib/contract.gno @@ -0,0 +1,11 @@ +package token_lib + +import "std" + +func TestGetCaller() { + println("token_lib.TestGetCaller=", std.GetCaller()) +} + +func TestGetOrigCaller() { + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +} diff --git a/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno index e69de29bb2d..4bb7e18babe 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/d_vault_or_multisig/contract.gno @@ -0,0 +1,11 @@ +package token_lib + +import "std" + +func TestGetCaller() { + println("token_lib.TestGetCaller=", std.GetCaller()) +} + +func TestGetOrigCaller() { + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +} diff --git a/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno b/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno index e69de29bb2d..4bb7e18babe 100644 --- a/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno +++ b/examples/gno.land/r/demo/x/caller_patterns/e_another_utility_lib/contract.gno @@ -0,0 +1,11 @@ +package token_lib + +import "std" + +func TestGetCaller() { + println("token_lib.TestGetCaller=", std.GetCaller()) +} + +func TestGetOrigCaller() { + println("token_lib.TestGetOrigCaller=", std.GetOrigCaller()) +}