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

test(e2e): add e2e test for v2 deposit and call with swap #3188

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

skosito
Copy link
Contributor

@skosito skosito commented Nov 20, 2024

Description

Similar to existing crosschain swap test, but crosschain swap test can't be used with v2 contracts yet. This test can be removed with this issue: #2711 but for now its needed to test similar scenario as issue on testnet, where there is a swap and withdraw in onCall function, and cosmos-sdk gas limit for MsgVoteInbound is reached.

This also confirms the fix: #3106 - checked locally, without this fix, cosmos sdk 7M gas is drained, because evm gas limit missing is calling eth_estimateGas which spends a lot of cosmos gas.

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

Release Notes

  • New Features

    • Whitelist functionality for SPL tokens on Solana.
    • Integration of SPL deposits and withdrawals.
    • New onCall function in the ZEVMSwapApp contract for enhanced cross-chain operations.
  • Bug Fixes

    • Resolved issues with emissions module registration and out-of-gas errors during omnichain calls.
    • Fixed potential panic situations in Bitcoin inscription parsing.
  • Tests

    • Added end-to-end tests for deposit and swap functionalities, enhancing testing coverage.

@skosito skosito added the V2_TESTS Run make start-v2-test label Nov 20, 2024
@skosito skosito linked an issue Nov 20, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Nov 20, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces a series of updates to the ZetaChain node, including new features for whitelisting SPL tokens on Solana, integration of SPL deposits and withdrawals, and the addition of end-to-end tests for deposit and swap functionalities. It also includes significant refactoring efforts, such as the removal of the HSM signer and simplifications in the zetaclientd configuration. Various fixes address issues within the emissions module, peer discovery mechanisms, and transaction handling, enhancing overall functionality and stability.

Changes

File Path Change Summary
changelog.md Updated to reflect new features, improvements, refactoring, fixes, and tests across ZetaChain node.
cmd/zetae2e/local/v2.go Added e2etests.TestV2DepositAndCallSwapName to startV2Tests for ERC20 token workflow testing.
e2e/contracts/zevmswap/ZEVMSwapApp.* Added onCall function to ZEVMSwapApp contract; updated ABI and binary data to reflect this.
e2e/e2etests/e2etests.go Introduced constant TestV2DepositAndCallSwapName and new E2E test for deposit and call with swap.
e2e/e2etests/test_v2_deposit_and_call_swap.go Added TestV2DepositAndCallSwap function to validate v2 contracts involving swaps and withdrawals.

Possibly related PRs

Suggested labels

no-changelog, SOLANA_TESTS, chain:solana

Suggested reviewers

  • fbac
  • kingpinXD
  • ws4charlie
  • brewmaster012
  • swift1337
  • gartnera
  • skosito

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (7)
e2e/e2etests/test_v2_deposit_and_call_swap.go (3)

44-49: Consider using a test helper for gas limit management

The gas limit modification is a critical part of the test but could be encapsulated better:

func withTemporaryGasLimit(r *runner.E2ERunner, gasLimit uint64, fn func() error) error {
    previousLimit := r.ZEVMAuth.GasLimit
    r.ZEVMAuth.GasLimit = gasLimit
    defer func() { r.ZEVMAuth.GasLimit = previousLimit }()
    return fn()
}

51-64: Consider extracting magic numbers into named constants

The test uses several magic numbers for token amounts and liquidity values. Consider defining these as named constants at the package level for better maintainability and clarity.

const (
    initialLiquidityAmount = 1e8
    minLiquidityAmount    = 1e5
    liquidityTimeoutMins  = 10
)

1-88: Consider adding test documentation and prerequisites

The test implements a complex scenario but lacks comprehensive documentation. Consider adding:

  1. A detailed test description in the function's documentation
  2. Prerequisites and setup requirements
  3. Expected outcomes and verification steps
  4. Cleanup procedures

Example documentation:

// TestV2DepositAndCallSwap validates the v2 deposit and call functionality with swap
// Prerequisites:
//   - Deployed v2 contracts
//   - Sufficient token balances
// Steps:
//   1. Creates token pair
//   2. Adds liquidity
//   3. Performs deposit and call
// Expected outcome:
//   - Successful swap execution
//   - Correct token balances
//   - OutboundMined CCTX status
e2e/contracts/zevmswap/ZEVMSwapApp.abi (1)

76-120: Consider architectural implications of duplicate function signatures

The newly added onCall function has an identical signature to the existing onCrossChainCall function. This raises several architectural considerations:

  1. Both functions accept the same parameters and have the same state mutability
  2. The duplication might indicate a need for a more elegant design pattern

Consider:

  • Implementing a shared internal function if the logic is similar
  • Clearly documenting the distinct purposes of each function
  • Adding appropriate access control mechanisms
cmd/zetae2e/local/v2.go (1)

Line range hint 89-91: Consider implementing a more modular test framework structure.

While the current implementation works well, there are opportunities for architectural improvements:

  1. Break down the test routine into smaller, focused test suites
  2. Implement a builder pattern for test configuration
  3. Consider using test fixtures for common setup scenarios

This would align with the TODO comment and make the test framework more maintainable and extensible.

e2e/e2etests/e2etests.go (1)

1077-1082: Consider adding test parameters for swap configuration.

The test registration looks good, but given that this test simulates a swap and withdrawal scenario with gas limit considerations, consider adding configuration parameters such as:

  • Swap amount
  • Gas limit thresholds
  • Token pairs for the swap

This would make the test more flexible for different test scenarios.

Example addition:

 runner.NewE2ETest(
   TestV2DepositAndCallSwapName,
   "evm -> zevm deposit and call with swap and withdraw",
-  []runner.ArgDefinition{},
+  []runner.ArgDefinition{
+    {Description: "swap amount", DefaultValue: "1000000000000000000"},
+    {Description: "gas limit", DefaultValue: "2000000"},
+  },
   TestV2DepositAndCallSwap,
 ),
e2e/contracts/zevmswap/ZEVMSwapApp.go (1)

337-356: Enhance parameter naming for better code clarity.

Consider renaming the arg0 parameter to context in the OnCall methods. Using a descriptive name improves readability and aligns with Go's best practices for expressive code.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 85d508a and 260c7dd.

⛔ Files ignored due to path filters (1)
  • e2e/contracts/zevmswap/ZEVMSwapApp.bin is excluded by !**/*.bin
📒 Files selected for processing (8)
  • changelog.md (1 hunks)
  • cmd/zetae2e/local/v2.go (1 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.abi (1 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.go (2 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.json (2 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.sol (1 hunks)
  • e2e/e2etests/e2etests.go (2 hunks)
  • e2e/e2etests/test_v2_deposit_and_call_swap.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
cmd/zetae2e/local/v2.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/contracts/zevmswap/ZEVMSwapApp.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/e2etests/e2etests.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/e2etests/test_v2_deposit_and_call_swap.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (10)
e2e/e2etests/test_v2_deposit_and_call_swap.go (2)

16-19: Consider adding test cleanup and documentation

The TODO comment indicates this test is temporary and should be removed after issue #2711 is completed. Consider:

  1. Adding a link to PR 3106 in the comment since it's related to the gas limit fix being tested
  2. Adding cleanup steps to remove test data after execution

85-88: Enhance error handling and test assertions

While the test verifies the CCTX status, consider adding more comprehensive assertions:

  1. Verify the token balances after the swap
  2. Add timeout handling for the WaitCctxMinedByInboundHash call
  3. Add assertions for the expected gas consumption
e2e/contracts/zevmswap/ZEVMSwapApp.abi (1)

76-120: Verify security considerations for onCall function

The ABI indicates this is a public function without visible access controls. Given its cross-chain nature:

Please ensure:

  1. The contract implementation includes appropriate access controls
  2. The function validates the Context parameters
  3. The function properly handles edge cases for amount and message parameters
cmd/zetae2e/local/v2.go (1)

43-43: LGTM! Test placement is well-considered.

The addition of TestV2DepositAndCallSwapName to the ERC20 token workflow group is appropriate. The test is correctly positioned after the basic deposit/call tests, ensuring necessary prerequisites (like ETH deposits for fees) are executed first.

Please verify that the test dependencies in TestV2DepositAndCallSwap align with the existing test order, particularly regarding any required initial state or token balances.

e2e/contracts/zevmswap/ZEVMSwapApp.sol (1)

114-116: Add slippage protection

The swap is currently configured with no minimum output amount (using 0), which could lead to significant slippage in production.

Consider adding a slippage parameter or minimum output calculation to protect against unfavorable trades.

e2e/contracts/zevmswap/ZEVMSwapApp.json (2)

77-121: LGTM! The onCall function addition is well-structured.

The function signature and parameter types are properly defined, following the same pattern as the existing onCrossChainCall function. This addition aligns well with the PR's objective of testing v2 deposit and call functionality with swaps.


194-194: Verify bytecode update for gas optimization.

The bytecode has been updated to include the new onCall function. Given that this PR aims to address gas consumption issues, particularly with the cosmos-sdk gas limit for MsgVoteInbound:

  1. Consider running gas estimation tests to verify the bytecode's gas efficiency
  2. Ensure the implementation doesn't introduce unnecessary gas overhead
e2e/e2etests/e2etests.go (1)

175-175: LGTM! Test name follows naming convention.

The constant name TestV2DepositAndCallSwapName follows the established pattern and clearly indicates its purpose.

changelog.md (1)

17-17: LGTM!

The changelog entry accurately reflects the PR's objective of adding end-to-end tests for v2 deposit and call with swap functionality.

e2e/contracts/zevmswap/ZEVMSwapApp.go (1)

41-42: ABI and bytecode are correctly updated to include the new onCall function.

The ABI and bytecode modifications accurately reflect the addition of the onCall method, ensuring that the contract bindings remain consistent with the contract's interface.

e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Outside diff range and nitpick comments (8)
e2e/e2etests/test_v2_deposit_and_call_swap.go (4)

16-19: Enhance TODO comment structure

Consider restructuring the TODO comment to follow a more standard format:

-// TODO: This test is similar to TestCrosschainSwap
-// purpose is to test similar scenario with v2 contracts where there is swap + withdraw in onCall
-// to showcase that it's not reverting with gas limit issues
-// this test should be removed when this issue is completed: https://github.com/zeta-chain/node/issues/2711
+// TODO(#2711): Temporary test for v2 contracts swap + withdraw in onCall
+// This test validates that the gas limit issues are resolved and should be removed
+// once the crosschain swap test supports v2 contracts.
+// Related test: TestCrosschainSwap

21-24: Add pair creation validation

Consider adding assertions to verify the pair was created successfully:

 tx, err := r.UniswapV2Factory.CreatePair(r.ZEVMAuth, r.ERC20ZRC20Addr, r.ETHZRC20Addr)
 require.NoError(r, err)
 utils.MustWaitForTxReceipt(r.Ctx, r.ZEVMClient, tx, r.Logger, r.ReceiptTimeout)
+pair, err := r.UniswapV2Factory.GetPair(nil, r.ERC20ZRC20Addr, r.ETHZRC20Addr)
+require.NoError(r, err)
+require.NotEqual(r, common.Address{}, pair, "pair should be created")

75-83: Validate memo encoding and document RevertOptions

Consider adding validation for the encoded memo and documenting the RevertOptions:

+// Validate memo structure
+require.Greater(r, len(memobytes), 0, "encoded memo should not be empty")

+// RevertOptions with zero gas limit means use the default gas limit
 tx = r.V2ERC20DepositAndCall(
     r.ZEVMSwapAppAddr,
     big.NewInt(8e7),
     memobytes,
     gatewayevm.RevertOptions{OnRevertGasLimit: big.NewInt(0)},
 )

84-88: Add comprehensive CCTX validation

Consider adding more assertions to validate the complete CCTX state:

 cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout)
 r.Logger.CCTX(*cctx, "deposit_and_call")
 require.Equal(r, crosschaintypes.CctxStatus_OutboundMined, cctx.CctxStatus.Status)
+require.NotEmpty(r, cctx.GetOutboundTxParams(), "outbound tx params should be present")
+require.Greater(r, cctx.GetOutboundTxGasUsed(), uint64(0), "gas should be used in outbound tx")
cmd/zetae2e/local/v2.go (1)

Line range hint 89-91: Consider implementing the planned test organization improvements.

The TODO comment indicates future plans to break down this routine (issue #2554). Given the addition of new test cases like the swap test, this might be a good time to consider that refactoring. A more granular organization could help with:

  • Clearer test dependencies and setup requirements
  • Better isolation of test scenarios (basic operations, swaps, reverts)
  • Improved maintainability and debugging
e2e/contracts/zevmswap/ZEVMSwapApp.go (3)

340-342: Enhance parameter naming for clarity

Consider renaming the parameter arg0 to context to improve readability and align with Go naming conventions.

Apply this diff to update the parameter name:

-func (_ZEVMSwapApp *ZEVMSwapAppTransactor) OnCall(opts *bind.TransactOpts, arg0 Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
-	return _ZEVMSwapApp.contract.Transact(opts, "onCall", arg0, zrc20, amount, message)
+func (_ZEVMSwapApp *ZEVMSwapAppTransactor) OnCall(opts *bind.TransactOpts, context Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
+	return _ZEVMSwapApp.contract.Transact(opts, "onCall", context, zrc20, amount, message)
}

347-349: Enhance parameter naming for clarity

Consider renaming the parameter arg0 to context to improve readability and align with Go naming conventions.

Apply this diff to update the parameter name:

-func (_ZEVMSwapApp *ZEVMSwapAppSession) OnCall(arg0 Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
-	return _ZEVMSwapApp.Contract.OnCall(&_ZEVMSwapApp.TransactOpts, arg0, zrc20, amount, message)
+func (_ZEVMSwapApp *ZEVMSwapAppSession) OnCall(context Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
+	return _ZEVMSwapApp.Contract.OnCall(&_ZEVMSwapApp.TransactOpts, context, zrc20, amount, message)
}

354-356: Enhance parameter naming for clarity

Consider renaming the parameter arg0 to context to improve readability and align with Go naming conventions.

Apply this diff to update the parameter name:

-func (_ZEVMSwapApp *ZEVMSwapAppTransactorSession) OnCall(arg0 Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
-	return _ZEVMSwapApp.Contract.OnCall(&_ZEVMSwapApp.TransactOpts, arg0, zrc20, amount, message)
+func (_ZEVMSwapApp *ZEVMSwapAppTransactorSession) OnCall(context Context, zrc20 common.Address, amount *big.Int, message []byte) (*types.Transaction, error) {
+	return _ZEVMSwapApp.Contract.OnCall(&_ZEVMSwapApp.TransactOpts, context, zrc20, amount, message)
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 85d508a and 260c7dd.

⛔ Files ignored due to path filters (1)
  • e2e/contracts/zevmswap/ZEVMSwapApp.bin is excluded by !**/*.bin
📒 Files selected for processing (8)
  • changelog.md (1 hunks)
  • cmd/zetae2e/local/v2.go (1 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.abi (1 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.go (2 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.json (2 hunks)
  • e2e/contracts/zevmswap/ZEVMSwapApp.sol (1 hunks)
  • e2e/e2etests/e2etests.go (2 hunks)
  • e2e/e2etests/test_v2_deposit_and_call_swap.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
cmd/zetae2e/local/v2.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/contracts/zevmswap/ZEVMSwapApp.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/e2etests/e2etests.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/e2etests/test_v2_deposit_and_call_swap.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (11)
e2e/contracts/zevmswap/ZEVMSwapApp.abi (2)

76-120: Clarify the purpose of duplicate function signatures

The newly added onCall function appears to have an identical signature to the existing onCrossChainCall function. Both functions accept the same parameters and have the same modifiers. This duplication could lead to confusion about which function should be used in different scenarios.

Could you please clarify:

  1. The specific use case for onCall vs onCrossChainCall
  2. Whether this is part of a transition strategy for v2 contracts
  3. If there are plans to deprecate one of these functions in the future

76-120: Verify v2 contract integration

The new onCall function appears to be part of the v2 deposit and call implementation mentioned in the PR objectives.

Please ensure:

  1. The function name and signature align with other v2 contract interfaces
  2. The Context struct fields (origin, sender, chainID) are compatible with v2 cross-chain communication protocols
  3. The function's nonpayable modifier is appropriate for the intended v2 deposit and call flow
cmd/zetae2e/local/v2.go (1)

43-43: LGTM! Verify test dependencies.

The addition of TestV2DepositAndCallSwapName to the ERC20 workflow test group is well-placed. Since swap operations typically require sufficient liquidity, ensure that the test has proper setup and dependencies (like TestOperationAddLiquidityETHName and TestOperationAddLiquidityERC20Name which are present in the revert test group).

e2e/contracts/zevmswap/ZEVMSwapApp.sol (1)

99-99: LGTM - Improves code readability

e2e/contracts/zevmswap/ZEVMSwapApp.json (2)

77-121: LGTM: Well-structured onCall function addition

The new onCall function is well-defined with appropriate parameter types and follows the same structure as the existing onCrossChainCall function, which is suitable for the v2 deposit and call testing requirements.

Please ensure that the gas consumption patterns of this function have been tested thoroughly, particularly given the PR's focus on addressing gas limit issues in MsgVoteInbound.


194-194: LGTM: Bytecode update is consistent

The bytecode has been properly updated to include the new onCall function implementation.

e2e/e2etests/e2etests.go (2)

175-175: LGTM: Constant follows naming convention.

The constant name and value follow the established pattern in the file.


1077-1082: Consider adding test arguments for configurability.

The test case is well-integrated and matches the PR objectives. However, consider whether parameters like swap amounts or gas limits should be configurable through arguments, similar to other test cases in the suite.

Example addition:

 runner.NewE2ETest(
   TestV2DepositAndCallSwapName,
   "evm -> zevm deposit and call with swap and withdraw",
-  []runner.ArgDefinition{},
+  []runner.ArgDefinition{
+    {Description: "deposit amount in wei", DefaultValue: "1000000000000000000"},
+    {Description: "swap amount in wei", DefaultValue: "500000000000000000"},
+  },
   TestV2DepositAndCallSwap,
 ),
changelog.md (1)

17-17: LGTM!

The changelog entry accurately reflects the PR objectives, documenting the addition of the e2e test for v2 deposit and call with swap functionality.

e2e/contracts/zevmswap/ZEVMSwapApp.go (2)

41-42: ABI and binary data updated correctly

The ABI and Bin fields have been updated to include the new onCall method, reflecting the contract changes accurately.


340-356: Verify security considerations for 'OnCall' method

Ensure that the OnCall method's implementation accounts for necessary validations to prevent potential security vulnerabilities, especially since it differs from OnCrossChainCall by not enforcing sender validation.

e2e/e2etests/test_v2_deposit_and_call_swap.go Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
e2e/contracts/zevmswap/ZEVMSwapApp.sol Show resolved Hide resolved
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Small comments

e2e/e2etests/e2etests.go Outdated Show resolved Hide resolved
e2e/e2etests/e2etests.go Outdated Show resolved Hide resolved
@lumtis
Copy link
Member

lumtis commented Nov 20, 2024

I'm also thinking maybe we can look into movin the logic in TestDAppV2.
To run test on live networks we need contracts that can be put in the config.

But this would be much easier to manage if we have a single test contract we have to deploy for live networks

@skosito skosito added this pull request to the merge queue Nov 21, 2024
Merged via the queue into develop with commit 495235e Nov 21, 2024
41 checks passed
@skosito skosito deleted the swap-v2-e2e-test branch November 21, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:cli V2_TESTS Run make start-v2-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the crosschain swap test to use V2 or add new one
3 participants