XCM WeightTrader: Swap Fee Asset for Native Asset (#1845)
Implements an XCM executor `WeightTrader`, facilitating fee payments in any asset that can be exchanged for a native asset. A few constraints need to be observed: - `buy_weight` and `refund` operations must be atomic, as another weight trader implementation might be attempted in case of failure. - swap credit must be utilized since there isn’t an account to which an asset of some class can be deposited with a guarantee to meet the existential deposit requirement. Also, operating with credits enhances the efficiency of the weight trader - https://github.com/paritytech/polkadot-sdk/pull/1677 related PRs: - (depends) https://github.com/paritytech/polkadot-sdk/pull/2031 - (depends) https://github.com/paritytech/polkadot-sdk/pull/1677 - (caused) https://github.com/paritytech/polkadot-sdk/pull/1847 - (caused) https://github.com/paritytech/polkadot-sdk/pull/1876 // DONE: impl `OnUnbalanced` for a `fungible/s` credit // DONE: make the trader free from a concept of a native currency and drop few fallible conversions. related issue - https://github.com/paritytech/polkadot-sdk/issues/1842 // DONE: tests --------- Co-authored-by:joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by:
Liam Aharon <liam.aharon@hotmail.com>
parent
4c4963a1
Showing
- Cargo.lock 4 additions, 0 deletionsCargo.lock
- cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs 0 additions, 75 deletions.../emulated/tests/assets/asset-hub-rococo/src/tests/send.rs
- cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs 127 additions, 0 deletions.../emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs
- cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/send.rs 0 additions, 75 deletions...emulated/tests/assets/asset-hub-westend/src/tests/send.rs
- cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/swap.rs 127 additions, 0 deletions...emulated/tests/assets/asset-hub-westend/src/tests/swap.rs
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml 1 addition, 0 deletions...tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs 2 additions, 1 deletion...tests/emulated/tests/bridges/bridge-hub-rococo/src/lib.rs
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs 44 additions, 1 deletion...ts/bridges/bridge-hub-rococo/src/tests/asset_transfers.rs
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/Cargo.toml 1 addition, 0 deletions...ests/emulated/tests/bridges/bridge-hub-westend/Cargo.toml
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs 2 additions, 1 deletion...ests/emulated/tests/bridges/bridge-hub-westend/src/lib.rs
- cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs 43 additions, 0 deletions...s/bridges/bridge-hub-westend/src/tests/asset_transfers.rs
- cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs 11 additions, 8 deletions...us/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
- cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs 19 additions, 28 deletions...chains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs
- cumulus/parachains/runtimes/assets/asset-hub-rococo/tests/tests.rs 211 additions, 286 deletions...arachains/runtimes/assets/asset-hub-rococo/tests/tests.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs 11 additions, 8 deletions...s/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs 19 additions, 28 deletions...hains/runtimes/assets/asset-hub-westend/src/xcm_config.rs
- cumulus/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs 211 additions, 280 deletions...rachains/runtimes/assets/asset-hub-westend/tests/tests.rs
- cumulus/parachains/runtimes/assets/common/src/lib.rs 10 additions, 0 deletionscumulus/parachains/runtimes/assets/common/src/lib.rs
- cumulus/parachains/runtimes/assets/test-utils/Cargo.toml 2 additions, 0 deletionscumulus/parachains/runtimes/assets/test-utils/Cargo.toml
- cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs 56 additions, 21 deletions.../runtimes/assets/test-utils/src/test_cases_over_bridge.rs
Please register or sign in to comment