Skip to content

Commit 740f0b8

Browse files
authored
refactor: make weight argument in xtokens transfers optional (#841)
* refactor: make weight argument in xtokens be of type WeightLimit * refactor: rename dest_weight -> dest_weight_limit
1 parent 43d237d commit 740f0b8

File tree

4 files changed

+192
-115
lines changed

4 files changed

+192
-115
lines changed

asset-registry/src/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn send_self_parachain_asset_to_sibling() {
118118
)
119119
.into()
120120
),
121-
40,
121+
WeightLimit::Unlimited,
122122
));
123123

124124
assert_eq!(ParaTokens::free_balance(CurrencyId::RegisteredAsset(1), &ALICE), 500);
@@ -204,7 +204,7 @@ fn send_sibling_asset_to_non_reserve_sibling() {
204204
)
205205
.into()
206206
),
207-
40
207+
WeightLimit::Unlimited
208208
));
209209
assert_eq!(ParaTokens::free_balance(CurrencyId::RegisteredAsset(1), &ALICE), 500);
210210
});
@@ -302,7 +302,7 @@ fn test_fixed_rate_asset_trader() {
302302
)
303303
.into()
304304
),
305-
40,
305+
WeightLimit::Unlimited,
306306
));
307307
});
308308

@@ -353,7 +353,7 @@ fn test_fixed_rate_asset_trader() {
353353
)
354354
.into()
355355
),
356-
40,
356+
WeightLimit::Unlimited,
357357
));
358358
});
359359

traits/src/xcm_transfer.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use frame_support::dispatch::DispatchResult;
2-
use xcm::latest::{prelude::*, Weight};
2+
use xcm::latest::prelude::*;
33

44
/// Abstraction over cross-chain token transfers.
55
pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
@@ -9,14 +9,14 @@ pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
99
currency_id: CurrencyId,
1010
amount: Balance,
1111
dest: MultiLocation,
12-
dest_weight: Weight,
12+
dest_weight_limit: WeightLimit,
1313
) -> DispatchResult;
1414

1515
/// Transfer `MultiAsset`
1616
fn transfer_multi_asset(
1717
who: AccountId,
1818
asset: MultiAsset,
1919
dest: MultiLocation,
20-
dest_weight: Weight,
20+
dest_weight_limit: WeightLimit,
2121
) -> DispatchResult;
2222
}

0 commit comments

Comments
 (0)