mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Implement transfer_asset on CurrencyAdapter (#4549)
* Implement transfer_asset on CurrencyAdapter * Use Currency::transfer in transfer_asset * Add a test to assert that Currency::transfer was indeed used * Remove superfluous balance conversion to u128 * Rename transfer_asset and beam_asset Co-authored-by: Giles Cope <gilescope@gmail.com>
This commit is contained in:
@@ -118,14 +118,14 @@ impl<
|
||||
AccountId: Clone, // can't get away without it since Currency is generic over it.
|
||||
> TransactAsset for FungiblesTransferAdapter<Assets, Matcher, AccountIdConverter, AccountId>
|
||||
{
|
||||
fn transfer_asset(
|
||||
fn internal_transfer_asset(
|
||||
what: &MultiAsset,
|
||||
from: &MultiLocation,
|
||||
to: &MultiLocation,
|
||||
) -> result::Result<xcm_executor::Assets, XcmError> {
|
||||
log::trace!(
|
||||
target: "xcm::fungibles_adapter",
|
||||
"transfer_asset what: {:?}, from: {:?}, to: {:?}",
|
||||
"internal_transfer_asset what: {:?}, from: {:?}, to: {:?}",
|
||||
what, from, to
|
||||
);
|
||||
// Check we handle this asset.
|
||||
@@ -325,12 +325,12 @@ impl<
|
||||
>::withdraw_asset(what, who)
|
||||
}
|
||||
|
||||
fn transfer_asset(
|
||||
fn internal_transfer_asset(
|
||||
what: &MultiAsset,
|
||||
from: &MultiLocation,
|
||||
to: &MultiLocation,
|
||||
) -> result::Result<xcm_executor::Assets, XcmError> {
|
||||
FungiblesTransferAdapter::<Assets, Matcher, AccountIdConverter, AccountId>::transfer_asset(
|
||||
FungiblesTransferAdapter::<Assets, Matcher, AccountIdConverter, AccountId>::internal_transfer_asset(
|
||||
what, from, to,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user