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

It's always false... #13330

Merged
merged 1 commit into from
Jun 9, 2023
Merged
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
10 changes: 2 additions & 8 deletions frame/assets/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
}
}

let is_provider = false;
bkchr marked this conversation as resolved.
Show resolved Hide resolved
let is_required = is_provider && !frame_system::Pallet::<T>::can_dec_provider(who);
let must_keep_alive = keep_alive || is_required;

if rest < details.min_balance {
if must_keep_alive {
if keep_alive {
WouldDie
} else {
ReducedToZero(rest)
Expand Down Expand Up @@ -216,9 +212,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
frozen.checked_add(&details.min_balance).ok_or(ArithmeticError::Overflow)?;
account.balance.saturating_sub(required)
} else {
let is_provider = false;
let is_required = is_provider && !frame_system::Pallet::<T>::can_dec_provider(who);
if keep_alive || is_required {
if keep_alive {
// We want to keep the account around.
account.balance.saturating_sub(details.min_balance)
} else {
Expand Down