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: More E2E Tests #872

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

feat: More E2E Tests #872

wants to merge 15 commits into from

Conversation

shekohex
Copy link
Contributor

@shekohex shekohex commented Jan 7, 2025

Summary of changes
Changes introduced in this pull request:

This pull request includes several changes to improve the handling of ERC20 assets, session management, and the overall functionality of the multi-asset delegation pallet. The most important changes include the addition of a new precompile utility, updates to session handling, and various refactorings to simplify the codebase and enhance functionality.

ERC20 Asset Handling Enhancements:

  • Added a new precompile utility precompiles/erc20-utils to the project (Cargo.toml). [1] [2]
  • Refactored the process_execute_withdraw function to handle ERC20 assets using precompiles and removed redundant EVM address handling. (pallets/multi-asset-delegation/src/functions/deposit.rs) [1] [2]

Session Management Improvements:

  • Introduced RoundChangeSessionManager to handle round changes during new sessions. (pallets/multi-asset-delegation/src/lib.rs)
  • Updated session manager configuration to use RoundChangeSessionManager. (pallets/multi-asset-delegation/src/mock.rs)

Code Refactoring and Simplification:

  • Removed optional workspace dependencies for pallet-session and sp-staking. (pallets/multi-asset-delegation/Cargo.toml)
  • Simplified the handle_round_change function and removed unnecessary return types. (pallets/multi-asset-delegation/src/functions/session_manager.rs) [1] [2]

New Functionalities:

  • Added a new function ready_withdraw_requests to return an iterator over withdraw requests ready for execution. (pallets/multi-asset-delegation/src/functions/deposit.rs)
  • Implemented a new test to verify round changes on new sessions. (pallets/multi-asset-delegation/src/tests/session_manager.rs)

Minor Changes:

  • Modified the workflow to include the fast-runtime feature in the end-to-end test suite. (.github/workflows/checks.yml)
  • Added necessary imports and updated function signatures to improve code clarity and functionality. (pallets/multi-asset-delegation/src/functions.rs)

Implemented test cases

  1. Withdraw restaked assets in ERC20
  2. Withdraw restaked assets with custom asset ids.

Reference issue to close (if applicable)

Closes #868
Part of #861

@shekohex shekohex changed the title feat: move erc20 transfer to its own shared crate feat: More E2E Tests Jan 7, 2025
@shekohex shekohex force-pushed the shady/restaking-e2e-02 branch from d4c09fb to 578064e Compare January 9, 2025 13:28
@shekohex shekohex marked this pull request as ready for review January 9, 2025 13:33
@shekohex shekohex requested a review from drewstone January 9, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Ensure caller substrate and evm address always match
2 participants