Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: authenticated zevm -> evm call and e2e tests #2904

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [2861](https://github.com/zeta-chain/node/pull/2861) - emit events from staking precompile
* [2870](https://github.com/zeta-chain/node/pull/2870) - support for multiple Bitcoin chains in the zetaclient
* [2883](https://github.com/zeta-chain/node/pull/2883) - add chain static information for btc signet testnet
* [2904](https://github.com/zeta-chain/node/pull/2904) - authenticated zevm -> evm call
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"integrate authenticated calls smart contract functionality into protocol"


### Refactor

Expand Down
4 changes: 4 additions & 0 deletions cmd/zetae2e/local/v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ func startV2Tests(eg *errgroup.Group, conf config.Config, deployerRunner *runner
e2etests.TestV2ETHDepositAndCallName,
e2etests.TestV2ETHWithdrawName,
e2etests.TestV2ETHWithdrawAndCallName,
e2etests.TestV2ETHWithdrawAndAuthenticatedCallName,
e2etests.TestV2ETHWithdrawAndAuthenticatedCallThroughContractName,
Comment on lines +23 to +24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be refactored in a further PR but I think we set these as the standard withdraw test and rename the current withdraw tests into WithdrawArbitraryCall

e2etests.TestV2ZEVMToEVMCallName,
e2etests.TestV2ZEVMToEVMAuthenticatedCallName,
e2etests.TestV2ZEVMToEVMAuthenticatedCallThroughContractName,
e2etests.TestV2EVMToZEVMCallName,
))

Expand Down
2 changes: 2 additions & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57303,6 +57303,8 @@ definitions:
type: string
tx_finalization_status:
$ref: '#/definitions/crosschainTxFinalizationStatus'
is_arbitrary_call:
type: boolean
crosschainOutboundTracker:
type: object
properties:
Expand Down
1 change: 1 addition & 0 deletions docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ message MsgVoteInbound {
uint64 event_index = 15;
ProtocolContractVersion protocol_contract_version = 16;
RevertOptions revert_options = 17;
bool is_arbitrary_call = 18;
}
```

Expand Down
68 changes: 50 additions & 18 deletions e2e/e2etests/e2etests.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,28 @@ const (
/*
V2 smart contract tests
*/
TestV2ETHDepositName = "v2_eth_deposit"
TestV2ETHDepositAndCallName = "v2_eth_deposit_and_call"
TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert"
TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call"
TestV2ETHWithdrawName = "v2_eth_withdraw"
TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call"
TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert"
TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call"
TestV2ERC20DepositName = "v2_erc20_deposit"
TestV2ERC20DepositAndCallName = "v2_erc20_deposit_and_call"
TestV2ERC20DepositAndCallRevertName = "v2_erc20_deposit_and_call_revert"
TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call"
TestV2ERC20WithdrawName = "v2_erc20_withdraw"
TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call"
TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert"
TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call"
TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call"
TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call"
TestV2ETHDepositName = "v2_eth_deposit"
TestV2ETHDepositAndCallName = "v2_eth_deposit_and_call"
TestV2ETHDepositAndCallRevertName = "v2_eth_deposit_and_call_revert"
TestV2ETHDepositAndCallRevertWithCallName = "v2_eth_deposit_and_call_revert_with_call"
TestV2ETHWithdrawName = "v2_eth_withdraw"
TestV2ETHWithdrawAndCallName = "v2_eth_withdraw_and_call"
TestV2ETHWithdrawAndAuthenticatedCallName = "v2_eth_withdraw_and_authenticated_call"
TestV2ETHWithdrawAndAuthenticatedCallThroughContractName = "v2_eth_withdraw_and_authenticated_call_through_contract"
TestV2ETHWithdrawAndCallRevertName = "v2_eth_withdraw_and_call_revert"
TestV2ETHWithdrawAndCallRevertWithCallName = "v2_eth_withdraw_and_call_revert_with_call"
TestV2ERC20DepositName = "v2_erc20_deposit"
TestV2ERC20DepositAndCallName = "v2_erc20_deposit_and_call"
TestV2ERC20DepositAndCallRevertName = "v2_erc20_deposit_and_call_revert"
TestV2ERC20DepositAndCallRevertWithCallName = "v2_erc20_deposit_and_call_revert_with_call"
TestV2ERC20WithdrawName = "v2_erc20_withdraw"
TestV2ERC20WithdrawAndCallName = "v2_erc20_withdraw_and_call"
TestV2ERC20WithdrawAndCallRevertName = "v2_erc20_withdraw_and_call_revert"
TestV2ERC20WithdrawAndCallRevertWithCallName = "v2_erc20_withdraw_and_call_revert_with_call"
TestV2ZEVMToEVMCallName = "v2_zevm_to_evm_call"
TestV2ZEVMToEVMAuthenticatedCallName = "v2_zevm_to_evm_authenticated_call"
TestV2ZEVMToEVMAuthenticatedCallThroughContractName = "v2_zevm_to_evm_authenticated_call_through_contract"
TestV2EVMToZEVMCallName = "v2_evm_to_zevm_call"

/*
Operational tests
Expand Down Expand Up @@ -738,6 +742,22 @@ var AllE2ETests = []runner.E2ETest{
},
TestV2ETHWithdrawAndCall,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndAuthenticatedCallName,
"withdraw Ether from ZEVM and authenticated call a contract using V2 contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdrawAndAuthenticatedCall,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndAuthenticatedCallThroughContractName,
"withdraw Ether from ZEVM and authenticated call a contract using V2 contract through intermediary contract",
[]runner.ArgDefinition{
{Description: "amount in wei", DefaultValue: "100000"},
},
TestV2ETHWithdrawAndAuthenticatedCallThroughContract,
),
runner.NewE2ETest(
TestV2ETHWithdrawAndCallRevertName,
"withdraw Ether from ZEVM and call a contract using V2 contract that reverts",
Expand Down Expand Up @@ -824,6 +844,18 @@ var AllE2ETests = []runner.E2ETest{
[]runner.ArgDefinition{},
TestV2ZEVMToEVMCall,
),
runner.NewE2ETest(
TestV2ZEVMToEVMAuthenticatedCallName,
"zevm -> evm call using V2 contract",
[]runner.ArgDefinition{},
TestV2ZEVMToEVMAuthenticatedCall,
),
runner.NewE2ETest(
TestV2ZEVMToEVMAuthenticatedCallThroughContractName,
"zevm -> evm call using V2 contract through intermediary contract",
[]runner.ArgDefinition{},
TestV2ZEVMToEVMAuthenticatedCallThroughContract,
),
runner.NewE2ETest(
TestV2EVMToZEVMCallName,
"evm -> zevm call using V2 contract",
Expand Down
60 changes: 60 additions & 0 deletions e2e/e2etests/test_v2_eth_withdraw_and_authenticated_call.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package e2etests

import (
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol"

"github.com/zeta-chain/node/e2e/runner"
"github.com/zeta-chain/node/e2e/utils"
crosschaintypes "github.com/zeta-chain/node/x/crosschain/types"
)

const payloadMessageAuthenticatedWithdrawETH = "this is a test ETH withdraw and authenticated call payload"

func TestV2ETHWithdrawAndAuthenticatedCall(r *runner.E2ERunner, args []string) {
require.Len(r, args, 1)

previousGasLimit := r.ZEVMAuth.GasLimit
r.ZEVMAuth.GasLimit = 10000000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define Gas Limit as a Constant for Clarity

The gas limit is set directly to 10000000. Defining this value as a constant with a descriptive name improves readability and maintainability.

Apply this diff to define and use a constant:

+const highGasLimit = 10000000

 func TestV2ETHWithdrawAndAuthenticatedCall(r *runner.E2ERunner, args []string) {
     require.Len(r, args, 1)

     previousGasLimit := r.ZEVMAuth.GasLimit
-    r.ZEVMAuth.GasLimit = 10000000
+    r.ZEVMAuth.GasLimit = highGasLimit
     defer func() {
         r.ZEVMAuth.GasLimit = previousGasLimit
     }()

Committable suggestion was skipped due to low confidence.

defer func() {
r.ZEVMAuth.GasLimit = previousGasLimit
}()

amount, ok := big.NewInt(0).SetString(args[0], 10)
require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall")

r.AssertTestDAppEVMCalled(false, payloadMessageAuthenticatedWithdrawETH, amount)

r.ApproveETHZRC20(r.GatewayZEVMAddr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle Errors from ApproveETHZRC20 Function Call

The call to r.ApproveETHZRC20(r.GatewayZEVMAddr) does not check for errors. To ensure robustness, handle any potential errors returned by this function.

Apply this diff to handle the error:

-    r.ApproveETHZRC20(r.GatewayZEVMAddr)
+    err := r.ApproveETHZRC20(r.GatewayZEVMAddr)
+    require.NoError(r, err, "Failed to approve ETH ZRC20")
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
r.ApproveETHZRC20(r.GatewayZEVMAddr)
err := r.ApproveETHZRC20(r.GatewayZEVMAddr)
require.NoError(r, err, "Failed to approve ETH ZRC20")


// set expected sender
tx, err := r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From)
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout)

// perform the withdraw
tx = r.V2ETHWithdrawAndAuthenticatedCall(
r.TestDAppV2EVMAddr,
amount,
[]byte(payloadMessageAuthenticatedWithdrawETH),
gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)},
)
Comment on lines +39 to +44
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for Errors in V2ETHWithdrawAndAuthenticatedCall

The function r.V2ETHWithdrawAndAuthenticatedCall may return errors that are currently unchecked. Capturing and handling these errors can prevent unexpected failures during test execution.

Apply this diff to incorporate error handling:

-    tx = r.V2ETHWithdrawAndAuthenticatedCall(
+    tx, err = r.V2ETHWithdrawAndAuthenticatedCall(
         r.TestDAppV2EVMAddr,
         amount,
         []byte(payloadMessageAuthenticatedWithdrawETH),
         gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)},
     )
+    require.NoError(r, err, "Failed to perform V2 ETH withdraw and authenticated call")
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tx = r.V2ETHWithdrawAndAuthenticatedCall(
r.TestDAppV2EVMAddr,
amount,
[]byte(payloadMessageAuthenticatedWithdrawETH),
gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)},
)
tx, err = r.V2ETHWithdrawAndAuthenticatedCall(
r.TestDAppV2EVMAddr,
amount,
[]byte(payloadMessageAuthenticatedWithdrawETH),
gatewayzevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)},
)
require.NoError(r, err, "Failed to perform V2 ETH withdraw and authenticated call")


// wait for the cctx to be mined
cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
r.Logger.CCTX(*cctx, "withdraw")
require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status)

r.AssertTestDAppEVMCalled(true, payloadMessageAuthenticatedWithdrawETH, amount)

// check expected sender was used
senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage(
&bind.CallOpts{},
[]byte(payloadMessageAuthenticatedWithdrawETH),
)
require.NoError(r, err)
require.Equal(r, r.ZEVMAuth.From, senderForMsg)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package e2etests

import (
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/node/e2e/runner"
"github.com/zeta-chain/node/e2e/utils"
testgatewayzevmcaller "github.com/zeta-chain/node/pkg/contracts/testgatewayzevmcaller"
crosschaintypes "github.com/zeta-chain/node/x/crosschain/types"
)

const payloadMessageAuthenticatedWithdrawETHThroughContract = "this is a test ETH withdraw and authenticated call payload through contract"

func TestV2ETHWithdrawAndAuthenticatedCallThroughContract(r *runner.E2ERunner, args []string) {
require.Len(r, args, 1)

previousGasLimit := r.ZEVMAuth.GasLimit
r.ZEVMAuth.GasLimit = 10000000
defer func() {
r.ZEVMAuth.GasLimit = previousGasLimit
}()

amount, ok := big.NewInt(0).SetString(args[0], 10)
require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update error message to reflect the correct function name.

The error message references TestV2ETHWithdrawAndCall, which does not match the actual function name TestV2ETHWithdrawAndAuthenticatedCallThroughContract. This inconsistency may cause confusion during debugging.

Apply this diff to correct the error message:

-	require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall")
+	require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndAuthenticatedCallThroughContract")
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndCall")
require.True(r, ok, "Invalid amount specified for TestV2ETHWithdrawAndAuthenticatedCallThroughContract")


// deploy caller contract and send it gas zrc20 to pay gas fee
gatewayCallerAddr, tx, gatewayCaller, err := testgatewayzevmcaller.DeployTestGatewayZEVMCaller(
r.ZEVMAuth,
r.ZEVMClient,
r.GatewayZEVMAddr,
r.WZetaAddr,
)
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout)

tx, err = r.ETHZRC20.Transfer(r.ZEVMAuth, gatewayCallerAddr, big.NewInt(100000000000000000))
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout)

// set expected sender
tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, gatewayCallerAddr)
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout)

// perform the authenticated call
tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr,
amount,
[]byte(payloadMessageAuthenticatedWithdrawETHThroughContract),
testgatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)})
Comment on lines +49 to +52
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle potential errors returned by V2ETHWithdrawAndAuthenticatedCallThroughContract.

The function r.V2ETHWithdrawAndAuthenticatedCallThroughContract may return an error, but the current implementation does not handle it. Omitting this check could lead to unnoticed failures and make debugging difficult.

Apply this diff to handle the error:

-	tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr,
+	tx, err = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr,
 		amount,
 		[]byte(payloadMessageAuthenticatedWithdrawETHThroughContract),
 		testgatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)})
+
+	require.NoError(r, err)

Committable suggestion was skipped due to low confidence.


utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout)
cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
r.Logger.CCTX(*cctx, "withdraw")
require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status)

r.AssertTestDAppEVMCalled(true, payloadMessageAuthenticatedWithdrawETHThroughContract, amount)

// check expected sender was used
senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage(
&bind.CallOpts{},
[]byte(payloadMessageAuthenticatedWithdrawETHThroughContract),
)
require.NoError(r, err)
require.Equal(r, gatewayCallerAddr, senderForMsg)

// set expected sender to wrong one
tx, err = r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From)
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout)

// repeat authenticated call through contract, should revert because of wrong sender
tx = r.V2ETHWithdrawAndAuthenticatedCallThroughContract(gatewayCaller, r.TestDAppV2EVMAddr,
amount,
[]byte(payloadMessageAuthenticatedWithdrawETHThroughContract),
testgatewayzevmcaller.RevertOptions{OnRevertGasLimit: big.NewInt(0)})

utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout)
cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
r.Logger.CCTX(*cctx, "withdraw")
require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status)
Comment on lines +81 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add error handling for WaitCctxMinedByInboundHash.

The function utils.WaitCctxMinedByInboundHash might return an error or a nil cctx object. Currently, the code assumes it always succeeds, which could lead to panics if it fails. Adding an error check ensures robustness.

Apply this diff to handle potential errors:

-	cctx = utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
+	cctx, err := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
+	require.NoError(r, err)

Committable suggestion was skipped due to low confidence.

}
51 changes: 51 additions & 0 deletions e2e/e2etests/test_v2_zevm_to_evm_authenticated_call.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package e2etests

import (
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol"

"github.com/zeta-chain/node/e2e/runner"
"github.com/zeta-chain/node/e2e/utils"
crosschaintypes "github.com/zeta-chain/node/x/crosschain/types"
)

const payloadMessageEVMAuthenticatedCall = "this is a test EVM authenticated call payload"

func TestV2ZEVMToEVMAuthenticatedCall(r *runner.E2ERunner, args []string) {
require.Len(r, args, 0)

r.AssertTestDAppEVMCalled(false, payloadMessageEVMAuthenticatedCall, big.NewInt(0))

// necessary approval for fee payment
r.ApproveETHZRC20(r.GatewayZEVMAddr)

// set expected sender
tx, err := r.TestDAppV2EVM.SetExpectedOnCallSender(r.EVMAuth, r.ZEVMAuth.From)
require.NoError(r, err)
utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout)

// perform the authenticated call
tx = r.V2ZEVMToEMVAuthenticatedCall(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the function name V2ZEVMToEMVAuthenticatedCall to V2ZEVMToEVMAuthenticatedCall.

The function name appears to have a typo. Changing EMV to EVM ensures consistency and prevents potential confusion.

Apply this diff to correct the function name:

-tx = r.V2ZEVMToEMVAuthenticatedCall(
+tx = r.V2ZEVMToEVMAuthenticatedCall(
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tx = r.V2ZEVMToEMVAuthenticatedCall(
tx = r.V2ZEVMToEVMAuthenticatedCall(

r.TestDAppV2EVMAddr,
[]byte(payloadMessageEVMAuthenticatedCall),
gatewayzevm.RevertOptions{
OnRevertGasLimit: big.NewInt(0),
},
)

// wait for the cctx to be mined
cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
r.Logger.CCTX(*cctx, "call")
require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status)

// check the payload was received on the contract
r.AssertTestDAppEVMCalled(true, payloadMessageEVMAuthenticatedCall, big.NewInt(0))

// check expected sender was used
senderForMsg, err := r.TestDAppV2EVM.SenderWithMessage(&bind.CallOpts{}, []byte(payloadMessageEVMAuthenticatedCall))
require.NoError(r, err)
require.Equal(r, r.ZEVMAuth.From, senderForMsg)
}
Loading
Loading