From d4fcb123eb237dd6dd51917ee1120edf0bd47f84 Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 6 Nov 2024 14:03:28 +0100 Subject: [PATCH 1/4] update test --- e2e/e2etests/test_v2_erc20_withdraw_and_call.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go index fbc9e2ae7a..8d8f916576 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call.go @@ -12,16 +12,17 @@ import ( crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" ) -func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, _ []string) { +func TestV2ERC20WithdrawAndCall(r *runner.E2ERunner, args []string) { + require.Len(r, args, 1) + previousGasLimit := r.ZEVMAuth.GasLimit r.ZEVMAuth.GasLimit = 10000000 defer func() { r.ZEVMAuth.GasLimit = previousGasLimit }() - // called with fixed amount without arg since onCall implementation is for TestDappV2 is simple and generic - // without decoding the payload and amount handling for erc20, purpose of test is to verify correct sender and payload are used - amount := big.NewInt(10000) + amount, ok := big.NewInt(0).SetString(args[0], 10) + require.True(r, ok, "Invalid amount specified for TestV2ERC20WithdrawAndCall") payload := randomPayload(r) From 68539e26f3b3a9a5f456cca2deef7fb3f0c4cb60 Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 6 Nov 2024 14:03:37 +0100 Subject: [PATCH 2/4] set args --- e2e/e2etests/e2etests.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 82764cb537..1ebd8c49f8 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -955,13 +955,17 @@ var AllE2ETests = []runner.E2ETest{ runner.NewE2ETest( TestV2ERC20WithdrawAndCallName, "withdraw ERC20 from ZEVM and authenticated call a contract using V2 contract", - []runner.ArgDefinition{}, + []runner.ArgDefinition{ + {Description: "amount", DefaultValue: "1000"}, + }, TestV2ERC20WithdrawAndCall, ), runner.NewE2ETest( TestV2ERC20WithdrawAndCallNoMessageName, "withdraw ERC20 from ZEVM and authenticated call a contract using V2 contract with no message", - []runner.ArgDefinition{}, + []runner.ArgDefinition{ + {Description: "amount", DefaultValue: "1000"}, + }, TestV2ERC20WithdrawAndCallNoMessage, ), runner.NewE2ETest( From c0400e7edb9022b28f1770097d9b13404fff6ee5 Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 6 Nov 2024 14:09:36 +0100 Subject: [PATCH 3/4] add missing test --- cmd/zetae2e/local/v2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/zetae2e/local/v2.go b/cmd/zetae2e/local/v2.go index 22de8a6c51..4515f62b8c 100644 --- a/cmd/zetae2e/local/v2.go +++ b/cmd/zetae2e/local/v2.go @@ -39,6 +39,7 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner e2etests.TestV2ERC20WithdrawAndArbitraryCallName, e2etests.TestV2ERC20WithdrawAndCallName, e2etests.TestV2ERC20DepositAndCallNoMessageName, + e2etests.TestV2ERC20WithdrawAndCallNoMessageName, )) // Test revert cases for gas token workflow From 43be4438b4dfc82adca3a694650dbdb1068bb272 Mon Sep 17 00:00:00 2001 From: lumtis Date: Fri, 8 Nov 2024 10:55:38 +0100 Subject: [PATCH 4/4] fix test --- e2e/e2etests/test_v2_erc20_withdraw_and_call_no_message.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2etests/test_v2_erc20_withdraw_and_call_no_message.go b/e2e/e2etests/test_v2_erc20_withdraw_and_call_no_message.go index 50396ee58c..09d884f94a 100644 --- a/e2e/e2etests/test_v2_erc20_withdraw_and_call_no_message.go +++ b/e2e/e2etests/test_v2_erc20_withdraw_and_call_no_message.go @@ -43,7 +43,7 @@ func TestV2ERC20WithdrawAndCallNoMessage(r *runner.E2ERunner, args []string) { // check called messageIndex, err := r.TestDAppV2EVM.GetNoMessageIndex(&bind.CallOpts{}, r.EVMAddress()) require.NoError(r, err) - r.AssertTestDAppEVMCalled(true, messageIndex, amount) + r.AssertTestDAppEVMCalled(true, messageIndex, big.NewInt(0)) // check expected sender was used senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage(