diff --git a/frame/balances/src/impl_currency.rs b/frame/balances/src/impl_currency.rs index 9f764a37b8b89..baa153c119b20 100644 --- a/frame/balances/src/impl_currency.rs +++ b/frame/balances/src/impl_currency.rs @@ -846,17 +846,18 @@ where type MaxLocks = T::MaxLocks; - // Set a lock on the balance of `who`. - // Is a no-op if lock amount is zero or `reasons` `is_none()`. + // Set or alter a lock on the balance of `who`. fn set_lock( id: LockIdentifier, who: &T::AccountId, amount: T::Balance, reasons: WithdrawReasons, ) { - if amount.is_zero() || reasons.is_empty() { + if reasons.is_empty() || amount.is_zero() { + Self::remove_lock(id, who); return } + let mut new_lock = Some(BalanceLock { id, amount, reasons: reasons.into() }); let mut locks = Self::locks(who) .into_iter() diff --git a/frame/offences/benchmarking/src/lib.rs b/frame/offences/benchmarking/src/lib.rs index e7fc39657a190..92a87fb58b8c5 100644 --- a/frame/offences/benchmarking/src/lib.rs +++ b/frame/offences/benchmarking/src/lib.rs @@ -429,9 +429,9 @@ benchmarks! { + 1 // offence + 3 // reporter (reward + endowment) + 1 // offenders reported - + 2 // offenders slashed + + 3 // offenders slashed + 1 // offenders chilled - + 2 * n // nominators slashed + + 3 * n // nominators slashed ); } @@ -466,9 +466,9 @@ benchmarks! { + 1 // offence + 3 // reporter (reward + endowment) + 1 // offenders reported - + 2 // offenders slashed + + 3 // offenders slashed + 1 // offenders chilled - + 2 * n // nominators slashed + + 3 * n // nominators slashed ); }