Skip to content

Commit

Permalink
feat:Make the XcmTransfer trait support transfer_multiasset_with_fee (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hqwangningbo authored Jan 12, 2023
1 parent 04e67e6 commit 80ed32d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions traits/src/xcm_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
dest: MultiLocation,
dest_weight_limit: WeightLimit,
) -> DispatchResult;

/// Transfer `MultiAssetWithFee`
fn transfer_multiasset_with_fee(
who: AccountId,
asset: MultiAsset,
fee: MultiAsset,
dest: MultiLocation,
dest_weight_limit: WeightLimit,
) -> DispatchResult;
}
11 changes: 11 additions & 0 deletions xtokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,17 @@ pub mod module {
) -> DispatchResult {
Self::do_transfer_multiasset(who, asset, dest, dest_weight_limit)
}

#[require_transactional]
fn transfer_multiasset_with_fee(
who: T::AccountId,
asset: MultiAsset,
fee: MultiAsset,
dest: MultiLocation,
dest_weight_limit: WeightLimit,
) -> DispatchResult {
Self::do_transfer_multiasset_with_fee(who, asset, fee, dest, dest_weight_limit)
}
}
}

Expand Down

0 comments on commit 80ed32d

Please sign in to comment.