Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add debug assertions to check that the returned cursor is None
  • Loading branch information
surajk-m committed Apr 12, 2023
commit 321f55f0c2647c114afca16036f621f68389f36c
6 changes: 3 additions & 3 deletions frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,9 @@ impl<T: Config> Pallet<T> {

/// Clear all era information for given era.
pub(crate) fn clear_era_information(era_index: EraIndex) {
let _ = <ErasStakers<T>>::clear_prefix(era_index, u32::MAX, None);
let _ = <ErasStakersClipped<T>>::clear_prefix(era_index, u32::MAX, None);
let _ = <ErasValidatorPrefs<T>>::clear_prefix(era_index, u32::MAX, None);
debug_assert!(<ErasStakers<T>>::clear_prefix(era_index, u32::MAX, None).maybe_cursor.is_none());
debug_assert!(<ErasStakersClipped<T>>::clear_prefix(era_index, u32::MAX, None).maybe_cursor.is_none());
debug_assert!(<ErasValidatorPrefs<T>>::clear_prefix(era_index, u32::MAX, None).maybe_cursor.is_none());
<ErasValidatorReward<T>>::remove(era_index);
<ErasRewardPoints<T>>::remove(era_index);
<ErasTotalStake<T>>::remove(era_index);
Expand Down