Skip to content

Commit 43a25f7

Browse files
authored
orml-xtokens transfer docs (#569)
* orml-xtokens transfer only guarantees sending, but not receiving. * Explain . * More docstring.
1 parent 9ddd4da commit 43a25f7

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

xtokens/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Overview
44

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

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

1514
#### Integration tests
1615

17-
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:
16+
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:
1817

1918
- Transfer relay chain tokens to relay chain.
2019
- Transfer tokens issued by parachain A, from parachain A to parachain B.

xtokens/src/lib.rs

+22
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ pub mod module {
140140
#[pallet::call]
141141
impl<T: Config> Pallet<T> {
142142
/// Transfer native currencies.
143+
///
144+
/// `dest_weight` is the weight for XCM execution on the dest chain, and
145+
/// it would be charged from the transferred assets. If set below
146+
/// requirements, the execution may fail and assets wouldn't be
147+
/// received.
148+
///
149+
/// It's a no-op if any error on local XCM execution or message sending.
150+
/// Note sending assets out per se doesn't guarantee they would be
151+
/// received. Receiving depends on if the XCM message could be delivered
152+
/// by the network, and if the receiving chain would handle
153+
/// messages correctly.
143154
#[pallet::weight(Pallet::<T>::weight_of_transfer(currency_id.clone(), *amount, &dest))]
144155
pub fn transfer(
145156
origin: OriginFor<T>,
@@ -174,6 +185,17 @@ pub mod module {
174185
}
175186

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

0 commit comments

Comments
 (0)