Skip to content

Commit a4fdb39

Browse files
committed
improvements
1 parent ee9e335 commit a4fdb39

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

xcm-support/src/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use super::*;
66

7-
use orml_traits::ConcreteFungibleAsset;
7+
use orml_traits::{location::RelativeLocations, ConcreteFungibleAsset};
88

99
#[derive(Debug, PartialEq, Eq)]
1010
pub enum TestCurrencyId {
@@ -23,10 +23,10 @@ impl Convert<MultiLocation, Option<TestCurrencyId>> for CurrencyIdConvert {
2323
if l == MultiLocation::parent() {
2424
return Some(RelayChainToken);
2525
}
26-
if l == MultiLocation::new(1, X2(Parachain(1), GeneralKey(token_a))) {
26+
if l == MultiLocation::sibling_parachain_general_key(1, token_a) {
2727
return Some(TokenA);
2828
}
29-
if l == MultiLocation::new(1, X2(Parachain(2), GeneralKey(token_b))) {
29+
if l == MultiLocation::sibling_parachain_general_key(2, token_b) {
3030
return Some(TokenB);
3131
}
3232
None

xtokens/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub mod module {
251251
asset: MultiAsset,
252252
dest: MultiLocation,
253253
recipient: MultiLocation,
254-
dest_weight: u64,
254+
dest_weight: Weight,
255255
) -> Result<Xcm<T::Call>, DispatchError> {
256256
let buy_execution = Self::buy_execution(asset.clone(), &dest, dest_weight)?;
257257
Ok(WithdrawAsset {
@@ -269,7 +269,7 @@ pub mod module {
269269
asset: MultiAsset,
270270
reserve: MultiLocation,
271271
recipient: MultiLocation,
272-
dest_weight: u64,
272+
dest_weight: Weight,
273273
) -> Result<Xcm<T::Call>, DispatchError> {
274274
Ok(WithdrawAsset {
275275
assets: asset.clone().into(),
@@ -289,7 +289,7 @@ pub mod module {
289289
reserve: MultiLocation,
290290
dest: MultiLocation,
291291
recipient: MultiLocation,
292-
dest_weight: u64,
292+
dest_weight: Weight,
293293
) -> Result<Xcm<T::Call>, DispatchError> {
294294
let mut reanchored_dest = dest.clone();
295295
if reserve == MultiLocation::parent() {
@@ -332,7 +332,7 @@ pub mod module {
332332
}
333333
}
334334

335-
fn buy_execution(asset: MultiAsset, at: &MultiLocation, weight: u64) -> Result<Order<()>, DispatchError> {
335+
fn buy_execution(asset: MultiAsset, at: &MultiLocation, weight: Weight) -> Result<Order<()>, DispatchError> {
336336
let inv_at = T::LocationInverter::invert_location(at);
337337
let fees = asset.reanchored(&inv_at).map_err(|_| Error::<T>::CannotReanchor)?;
338338
Ok(BuyExecution {

0 commit comments

Comments
 (0)