-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for pallet-xcm precompile #35
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Agusrodri
commented
Apr 2, 2024
girazoki
reviewed
Apr 3, 2024
girazoki
reviewed
Apr 3, 2024
.collect::<Vec<Asset>>() | ||
.into(); | ||
|
||
let weight_limit = match weight.ref_time() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very interesting :)
girazoki
reviewed
Apr 3, 2024
albertov19
reviewed
Apr 4, 2024
librelois
reviewed
Apr 16, 2024
librelois
reviewed
Apr 16, 2024
librelois
approved these changes
Apr 17, 2024
Agusrodri
commented
Apr 18, 2024
RomarQ
approved these changes
Apr 23, 2024
ahmadkaouk
approved these changes
Apr 24, 2024
girazoki
approved these changes
Apr 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good Agus
Agusrodri
added a commit
that referenced
this pull request
May 14, 2024
* add pallet-xcm precompile * update interface docs * update comment for Unlimited weight * add comment in record_cost * mock cleanup * remove custom address from solidity interface * start converter implementation (PoC) * use size_of in AssetIdInfo * fmt * refactor converter * fmt * add Erc20PalletMatcher and adapt mock * remove unused import * minor fixes * add new functions * refactor ForeignAssetMatcher * rust fmt * add more tests and handle db reads costs * fix tests * use proper origin in mock * update solidity interface docs * remove TODO comment
1 task
Agusrodri
added a commit
that referenced
this pull request
May 16, 2024
* add pallet-xcm precompile * update interface docs * update comment for Unlimited weight * add comment in record_cost * mock cleanup * remove custom address from solidity interface * start converter implementation (PoC) * use size_of in AssetIdInfo * fmt * refactor converter * fmt * add Erc20PalletMatcher and adapt mock * remove unused import * minor fixes * add new functions * refactor ForeignAssetMatcher * rust fmt * add more tests and handle db reads costs * fix tests * use proper origin in mock * update solidity interface docs * remove TODO comment
Agusrodri
added a commit
that referenced
this pull request
May 16, 2024
* add pallet-xcm precompile * update interface docs * update comment for Unlimited weight * add comment in record_cost * mock cleanup * remove custom address from solidity interface * start converter implementation (PoC) * use size_of in AssetIdInfo * fmt * refactor converter * fmt * add Erc20PalletMatcher and adapt mock * remove unused import * minor fixes * add new functions * refactor ForeignAssetMatcher * rust fmt * add more tests and handle db reads costs * fix tests * use proper origin in mock * update solidity interface docs * remove TODO comment
Agusrodri
added a commit
that referenced
this pull request
May 16, 2024
* add pallet-xcm precompile * update interface docs * update comment for Unlimited weight * add comment in record_cost * mock cleanup * remove custom address from solidity interface * start converter implementation (PoC) * use size_of in AssetIdInfo * fmt * refactor converter * fmt * add Erc20PalletMatcher and adapt mock * remove unused import * minor fixes * add new functions * refactor ForeignAssetMatcher * rust fmt * add more tests and handle db reads costs * fix tests * use proper origin in mock * update solidity interface docs * remove TODO comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does it do?
This PR adds a precompile that allows to access the new
transfer_assets()
extrinsic of pallet-xcm, and leverage its use cases, like for instance, sending two assets with different reserves in the same message.Precompile functions
transferAssetsLocation
: sends XCM assets usingtransfer_assets
extrinsic of pallet-xcm. In this function we have to specify assets the same way the original extrinsic does (usingLocation
format).transferAssetsToPara20
: sends XCM assets to a 20 byte-like parachain viatransfer_assets
extrinsic of pallet-xcm. In this case, assets can be indicated through anaddress
format.transferAssetsToPara32
: same astransferAssetsToPara20
, with the difference that sends the assets to a 32 byte-like parachain. The parameters have the same format as intransferAssetsToPara20
.transferAssetsToRelay
: sends XCM assets to the relay chain throughtransfer_assets
extrinsic of pallet-xcm. This function also allows the possibility of sending assets in anaddress
format.