Skip to content

Commit

Permalink
refactor: make weight argument in xtokens transfers optional (#841)
Browse files Browse the repository at this point in the history
* refactor: make weight argument in xtokens be of type WeightLimit

* refactor: rename dest_weight -> dest_weight_limit
  • Loading branch information
sander2 authored Nov 16, 2022
1 parent 43d237d commit 740f0b8
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 115 deletions.
8 changes: 4 additions & 4 deletions asset-registry/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn send_self_parachain_asset_to_sibling() {
)
.into()
),
40,
WeightLimit::Unlimited,
));

assert_eq!(ParaTokens::free_balance(CurrencyId::RegisteredAsset(1), &ALICE), 500);
Expand Down Expand Up @@ -204,7 +204,7 @@ fn send_sibling_asset_to_non_reserve_sibling() {
)
.into()
),
40
WeightLimit::Unlimited
));
assert_eq!(ParaTokens::free_balance(CurrencyId::RegisteredAsset(1), &ALICE), 500);
});
Expand Down Expand Up @@ -302,7 +302,7 @@ fn test_fixed_rate_asset_trader() {
)
.into()
),
40,
WeightLimit::Unlimited,
));
});

Expand Down Expand Up @@ -353,7 +353,7 @@ fn test_fixed_rate_asset_trader() {
)
.into()
),
40,
WeightLimit::Unlimited,
));
});

Expand Down
6 changes: 3 additions & 3 deletions traits/src/xcm_transfer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use frame_support::dispatch::DispatchResult;
use xcm::latest::{prelude::*, Weight};
use xcm::latest::prelude::*;

/// Abstraction over cross-chain token transfers.
pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
Expand All @@ -9,14 +9,14 @@ pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
currency_id: CurrencyId,
amount: Balance,
dest: MultiLocation,
dest_weight: Weight,
dest_weight_limit: WeightLimit,
) -> DispatchResult;

/// Transfer `MultiAsset`
fn transfer_multi_asset(
who: AccountId,
asset: MultiAsset,
dest: MultiLocation,
dest_weight: Weight,
dest_weight_limit: WeightLimit,
) -> DispatchResult;
}
Loading

0 comments on commit 740f0b8

Please sign in to comment.