Skip to content
Snippets Groups Projects
Commit 78034dbc authored by Éloïs's avatar Éloïs
Browse files

fix(account):if new account can't pay NewAccountTax, it must be removed

parent cce73e96
No related branches found
No related tags found
1 merge request!60fix(account):if new account can't pay NewAccountTax, it must be removed
......@@ -198,13 +198,11 @@ pub mod pallet {
total_weight += 200_000;
}
} else {
// The charges could not be deducted, we slash the account
// The charges could not be deducted, we must destroy the account
let balance_to_suppr =
account_data.free.saturating_add(account_data.reserved);
// Force account data supression
frame_system::Account::<T>::mutate(&account_id, |a| {
a.data.set_balances(Default::default())
});
frame_system::Account::<T>::remove(&account_id);
Self::deposit_event(Event::ForceDestroy {
who: account_id,
balance: balance_to_suppr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment