From 5211583b190c345f3313ee8a3b90ef2300d99cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Fri, 28 May 2021 13:51:38 +0200 Subject: [PATCH] Companion for https://github.com/paritytech/substrate/pull/8476 --- xcm/xcm-builder/src/fungibles_adapter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xcm/xcm-builder/src/fungibles_adapter.rs b/xcm/xcm-builder/src/fungibles_adapter.rs index 4f2b0ce0e089..ba5990fa12ae 100644 --- a/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/xcm/xcm-builder/src/fungibles_adapter.rs @@ -16,7 +16,7 @@ use sp_std::{prelude::*, result, marker::PhantomData, borrow::Borrow}; use xcm::v0::{Error as XcmError, Result, MultiAsset, MultiLocation, Junction}; -use frame_support::traits::{Get, tokens::fungibles, Contains}; +use frame_support::traits::{Get, tokens::{fungibles, WhenDust}, Contains}; use xcm_executor::traits::{TransactAsset, Convert}; /// Asset transaction errors. @@ -154,7 +154,7 @@ impl< .map_err(|()| Error::AccountIdConversionFailed)?; let dest = AccountIdConverter::convert_ref(to) .map_err(|()| Error::AccountIdConversionFailed)?; - Assets::transfer(asset_id, &source, &dest, amount, true) + Assets::transfer(asset_id, &source, &dest, amount, WhenDust::KeepAlive) .map_err(|e| XcmError::FailedToTransactAsset(e.into()))?; Ok(what.clone().into()) } @@ -178,7 +178,7 @@ impl< // This is an asset whose teleports we track. let checking_account = CheckingAccount::get(); Assets::can_withdraw(asset_id, &checking_account, amount) - .into_result() + .into_result(false) .map_err(|_| XcmError::NotWithdrawable)?; } Ok(())