mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
[Collator Selection] Fix weight refund for set_candidacy_bond (#3643)
Fixes #3642 This PR implements the weight refund of `pallet_collator_selection::set_candidacy_bond` to account for no iterations when the bond is decreased. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -495,7 +495,11 @@ pub mod pallet {
|
||||
})
|
||||
.unwrap_or_default();
|
||||
Self::deposit_event(Event::NewCandidacyBond { bond_amount: bond });
|
||||
Ok(Some(T::WeightInfo::set_candidacy_bond(initial_len as u32, kicked as u32)).into())
|
||||
Ok(Some(T::WeightInfo::set_candidacy_bond(
|
||||
bond_increased.then(|| initial_len as u32).unwrap_or_default(),
|
||||
kicked as u32,
|
||||
))
|
||||
.into())
|
||||
}
|
||||
|
||||
/// Register this account as a collator candidate. The account must (a) already have
|
||||
|
||||
Reference in New Issue
Block a user