Skip to content

Girazoki dual token transferrable #683

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

Merged
merged 17 commits into from
Jan 27, 2022

Conversation

girazoki
Copy link
Contributor

This is a draft proposal (still many things to polish) for being able to send distinct asset and fee assets, as long as they have the same reserve chain. This is intended for chains that only accept a small subset of assets as for xcm fee payment. For instance. imagine Parachain A has pallet_assets with an asset AssetA and pallet_balances with its native token is NativeA.

A reciving parachain B would only need to support xcm payments in NativeA, and thus if one wants to send AssetA it would need to send also NativeA for fee payment. This is intended to potentially limit the assets a parachain supports for fee payment.

Additionally, a refactor is included in preparation for the possibility to, in the future, send more than just 2 tokens to a chain

@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #683 (5a59b21) into master (c283793) will decrease coverage by 0.35%.
The diff coverage is 63.95%.

❗ Current head 5a59b21 differs from pull request most recent head 28636a8. Consider uploading reports for the commit 28636a8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #683      +/-   ##
==========================================
- Coverage   74.80%   74.44%   -0.36%     
==========================================
  Files          82       82              
  Lines        7073     7150      +77     
==========================================
+ Hits         5291     5323      +32     
- Misses       1782     1827      +45     
Impacted Files Coverage Δ
xtokens/src/lib.rs 58.07% <48.76%> (-12.76%) ⬇️
xtokens/src/mock/mod.rs 93.47% <100.00%> (+0.97%) ⬆️
xtokens/src/tests.rs 98.97% <100.00%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6392ab8...28636a8. Read the comment docs.

@girazoki
Copy link
Contributor Author

Several tests to be added yet (specially for errors) but major changes have been:

  • A unique function where we calculate the transfer_kind, and also unique instruction functions to which we pass multiassets now.
  • Addition of two new extrinsics that allow to transfer up to two distinct assets as long as they share the same reserve
  • Removal of the ArithmeticOverflow error and use the MultiAssets push function instead, which already uses saturated addition

@xlc xlc requested review from shaunxw and zqhxuyuan January 25, 2022 22:44
@girazoki girazoki marked this pull request as ready for review January 27, 2022 16:06
@xlc xlc enabled auto-merge (squash) January 27, 2022 23:12
@xlc xlc merged commit e9ba349 into open-web3-stack:master Jan 27, 2022
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.

4 participants