feat: track pending payments to MBSM #851
Merged
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 introduces several significant changes to the
pallets/services
module, focusing on enhancing the handling of ERC20 tokens, adding new error types, and implementing mechanisms for staging and refunding service payments. Key changes include modifications to theerc20_transfer
function, the addition of new error types, and updates to the storage and event handling logic. Additionally, the pull request includes extensive updates to the testing framework to ensure the correctness of these new features.Enhancements to ERC20 Token Handling:
erc20_transfer
function to acceptfrom
as anH160
type instead of deriving it from the caller's account ID. This change simplifies the function and improves its flexibility.New Error Types:
MissingEVMOrigin
,ExpectedEVMAddress
, andExpectedAccountId
to handle specific error scenarios related to EVM addresses and account IDs.Storage and Event Handling:
StagingServicePayments
to hold service payment information temporarily until the service is initiated or refunded. This ensures accurate tracking and management of service payments.Testing Framework Updates:
These changes collectively enhance the robustness and functionality of the
pallets/services
module, particularly in handling ERC20 token transactions and managing service payments.Reference issue to close (if applicable)
Closes tangle-network/tnt-core#27