Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for Assets Freezer pallet #3131

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions xcm/xcm-builder/src/fungibles_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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())
}
Expand All @@ -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)
Copy link
Member Author

@athei athei May 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting keep_alive: false produces the same result as before but is it correct? @gavofyork

.map_err(|_| XcmError::NotWithdrawable)?;
}
Ok(())
Expand Down