mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 23:18:01 +00:00
Store validator self-vote in bags-list, and allow them to be trimmed for election (#10821)
* Implement the new validator-in-bags-list scenario + migration * Apply suggestions from code review Co-authored-by: Zeke Mostov <z.mostov@gmail.com> * some review comments * guard the migration * some review comments * Fix tests 🤦♂️ * Fix build * fix weight_of_fn * reformat line width * make const * use weight of fn cached * SortedListProvider -> VoterList * Fix all build and docs * check post migration Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
This commit is contained in:
@@ -38,11 +38,11 @@ const SEED: u32 = 0;
|
||||
pub fn clear_validators_and_nominators<T: Config>() {
|
||||
Validators::<T>::remove_all();
|
||||
|
||||
// whenever we touch nominators counter we should update `T::SortedListProvider` as well.
|
||||
// whenever we touch nominators counter we should update `T::VoterList` as well.
|
||||
Nominators::<T>::remove_all();
|
||||
|
||||
// NOTE: safe to call outside block production
|
||||
T::SortedListProvider::unsafe_clear();
|
||||
T::VoterList::unsafe_clear();
|
||||
}
|
||||
|
||||
/// Grab a funded user.
|
||||
|
||||
Reference in New Issue
Block a user