mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
Assets pallet: Don't allow set_min_balance when sufficient (#13510)
* Assets pallet: Don't allow set_min_balance when sufficient * fix * fix benchmark * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_assets * Update frame/assets/src/lib.rs * fix * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_assets --------- Co-authored-by: command-bot <> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -1540,8 +1540,12 @@ pub mod pallet {
|
||||
ensure!(origin == details.owner, Error::<T, I>::NoPermission);
|
||||
|
||||
let old_min_balance = details.min_balance;
|
||||
// Ensure that either the new min_balance is less than old min_balance or there aren't
|
||||
// any accounts holding the asset.
|
||||
// If the asset is marked as sufficient it won't be allowed to
|
||||
// change the min_balance.
|
||||
ensure!(!details.is_sufficient, Error::<T, I>::NoPermission);
|
||||
|
||||
// Ensure that either the new min_balance is less than old
|
||||
// min_balance or there aren't any accounts holding the asset.
|
||||
ensure!(
|
||||
min_balance < old_min_balance || details.accounts == 0,
|
||||
Error::<T, I>::NoPermission
|
||||
|
||||
Reference in New Issue
Block a user