Skip to content
Merged
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions tokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,11 +1355,16 @@ impl<T: Config> fungibles::MutateHold<T::AccountId> for Pallet<T> {
source: &T::AccountId,
dest: &T::AccountId,
amount: Self::Balance,
_best_effort: bool,
best_effort: bool,
on_hold: bool,
) -> Result<Self::Balance, DispatchError> {
let status = if on_hold { Status::Reserved } else { Status::Free };
Self::repatriate_reserved(asset_id, source, dest, amount, status)
ensure!(
amount <= Self::balance_on_hold(asset_id, source) || best_effort,
Error::<T>::BalanceTooLow
);
let gap = Self::repatriate_reserved(asset_id, source, dest, amount, status);
Ok(amount.saturating_sub(gap))
}
}

Expand Down