Skip to content

orml-xtokens transfer docs #569

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 3 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions xtokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Overview

The xtokens module provides cross-chain token transfer functionality, by cross-consensus
messages(XCM).
The xtokens module provides cross-chain token transfer functionality, by cross-consensus messages(XCM).

The xtokens module provides functions for
- Token transfer from parachains to relay chain.
Expand All @@ -14,7 +13,7 @@ The xtokens module provides functions for

#### Integration tests

Integration tests could be done manually after integrating xtokens into runtime. To cover the full features, set up at least 4 relay chain validators and 3 collators of different parachains, and use dispatchable calls to include all these scenarios:
Integration tests could be done manually after integrating orml-xtokens into runtime. To cover the full features, set up at least 4 relay chain validators and 3 collators of different parachains, and use dispatchable calls to include all these scenarios:

- Transfer relay chain tokens to relay chain.
- Transfer tokens issued by parachain A, from parachain A to parachain B.
Expand Down
22 changes: 22 additions & 0 deletions xtokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ pub mod module {
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Transfer native currencies.
///
/// `dest_weight` is the weight for XCM execution on the dest chain, and
/// it would be charged from the transferred assets. If set below
/// requirements, the execution may fail and assets wouldn't be
/// received.
///
/// It's a no-op if any error on local XCM execution or message sending.
/// Note sending assets out per se doesn't guarantee they would be
/// received. Receiving depends on if the XCM message could be delivered
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer(currency_id.clone(), *amount, &dest))]
pub fn transfer(
origin: OriginFor<T>,
Expand Down Expand Up @@ -174,6 +185,17 @@ pub mod module {
}

/// Transfer `MultiAsset`.
///
/// `dest_weight` is the weight for XCM execution on the dest chain, and
/// it would be charged from the transferred assets. If set below
/// requirements, the execution may fail and assets wouldn't be
/// received.
///
/// It's a no-op if any error on local XCM execution or message sending.
/// Note sending assets out per se doesn't guarantee they would be
/// received. Receiving depends on if the XCM message could be delivered
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer_multiasset(&asset, &dest))]
pub fn transfer_multiasset(
origin: OriginFor<T>,
Expand Down