mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +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:
@@ -270,8 +270,8 @@ impl crate::pallet::pallet::Config for Test {
|
||||
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
|
||||
type ElectionProvider = onchain::OnChainSequentialPhragmen<Self>;
|
||||
type GenesisElectionProvider = Self::ElectionProvider;
|
||||
// NOTE: consider a macro and use `UseNominatorsMap<Self>` as well.
|
||||
type SortedListProvider = BagsList;
|
||||
// NOTE: consider a macro and use `UseNominatorsAndValidatorsMap<Self>` as well.
|
||||
type VoterList = BagsList;
|
||||
type MaxUnlockingChunks = ConstU32<32>;
|
||||
type BenchmarkingConfig = TestBenchmarkingConfig;
|
||||
type WeightInfo = ();
|
||||
@@ -541,9 +541,9 @@ fn check_count() {
|
||||
assert_eq!(nominator_count, Nominators::<Test>::count());
|
||||
assert_eq!(validator_count, Validators::<Test>::count());
|
||||
|
||||
// the voters that the `SortedListProvider` list is storing for us.
|
||||
let external_voters = <Test as Config>::SortedListProvider::count();
|
||||
assert_eq!(external_voters, nominator_count);
|
||||
// the voters that the `VoterList` list is storing for us.
|
||||
let external_voters = <Test as Config>::VoterList::count();
|
||||
assert_eq!(external_voters, nominator_count + validator_count);
|
||||
}
|
||||
|
||||
fn check_ledgers() {
|
||||
|
||||
Reference in New Issue
Block a user