mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
[Feature] Part 1: add TargetList for validator ranking (#12034)
* [Feature] Part 1: add TargetList for validator ranking * remove redundant todo * remove typo * cleanup * implement score * more fixes * fix thresholds * fmt * Remove the stuff that has to come in the next PR, some fixes * extended balance import * Change all the references from VoteWeight to Self::Score * Add a migration for VoterBagsList * fix score * add targetList to nomination-pools tests * fix bench * address review comments * change get_npos_targets * address more comments * remove thresholds for the time being * fix instance reference * VoterBagsListInstance * reus * remove params that are not used yet * Introduced pre/post upgrade try-runtime checks * fix * fixes * fix migration * fix migration * fix post_upgrade * change * Fix * eloquent PhantomData * fix PD * more fixes * Update frame/staking/src/pallet/impls.rs Co-authored-by: Squirrel <gilescope@gmail.com> * is_nominator now works * fix test-staking * build fixes * fix remote-tests * Apply suggestions from code review Co-authored-by: parity-processbot <> Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -99,7 +99,7 @@ frame_support::construct_runtime!(
|
||||
Staking: pallet_staking::{Pallet, Call, Config<T>, Storage, Event<T>},
|
||||
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
|
||||
Historical: pallet_session::historical::{Pallet, Storage},
|
||||
BagsList: pallet_bags_list::{Pallet, Call, Storage, Event<T>},
|
||||
VoterBagsList: pallet_bags_list::<Instance1>::{Pallet, Call, Storage, Event<T>},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -240,9 +240,11 @@ parameter_types! {
|
||||
pub static LedgerSlashPerEra: (BalanceOf<Test>, BTreeMap<EraIndex, BalanceOf<Test>>) = (Zero::zero(), BTreeMap::new());
|
||||
}
|
||||
|
||||
impl pallet_bags_list::Config for Test {
|
||||
type VoterBagsListInstance = pallet_bags_list::Instance1;
|
||||
impl pallet_bags_list::Config<VoterBagsListInstance> for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = ();
|
||||
// Staking is the source of truth for voter bags list, since they are not kept up to date.
|
||||
type ScoreProvider = Staking;
|
||||
type BagThresholds = BagThresholds;
|
||||
type Score = VoteWeight;
|
||||
@@ -296,7 +298,8 @@ impl crate::pallet::pallet::Config for Test {
|
||||
type ElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
||||
type GenesisElectionProvider = Self::ElectionProvider;
|
||||
// NOTE: consider a macro and use `UseNominatorsAndValidatorsMap<Self>` as well.
|
||||
type VoterList = BagsList;
|
||||
type VoterList = VoterBagsList;
|
||||
type TargetList = UseValidatorsMap<Self>;
|
||||
type MaxUnlockingChunks = ConstU32<32>;
|
||||
type OnStakerSlash = OnStakerSlashMock<Test>;
|
||||
type BenchmarkingConfig = TestBenchmarkingConfig;
|
||||
|
||||
Reference in New Issue
Block a user