feat: add support for paying with ERC20 or AssetId for services #845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Changes introduced in this pull request:
This pull request includes several updates and enhancements across multiple files, focusing on configuration changes, code refactoring, and new functionality. Here are the most important changes:
New Functionality:
pallets/services/src/functions.rs
: Added new functionserc20_transfer
andquery_erc20_balance_of
to handle ERC20 token transfers and balance queries.Dependency and Import Updates:
pallets/services/Cargo.toml
: Addedpallet-assets
to the workspace dependencies and included it in thestd
feature set. [1] [2]pallets/services/src/lib.rs
: Introduced new traits for managing fungible assets and added new error types and event definitions for ERC20 transfers. [1] [2] [3]Enhancements and Bug Fixes:
pallets/services/src/lib.rs
: Enhanced therequest
function to support payment with different asset types, including native currency and ERC20 tokens. Added validation and transfer logic for these assets. [1] [2] [3]These changes collectively improve the codebase by enforcing consistent coding standards, refactoring for clarity, adding new functionalities, and enhancing existing features.
Reference issue to close (if applicable)
Part of tangle-network/tnt-core#28