Enable bags-list pallet in polkadot (#4080)

* Enable bags-list pallet in polkadot

* add files

* Remove trailing semicolon

* more fixes

* Update runtime/polkadot/src/lib.rs

* add features

* remove par

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Kian Paimani
2021-10-25 11:18:17 +01:00
committed by GitHub
parent 182667830f
commit f9bd3c576f
13 changed files with 382 additions and 21 deletions
+5 -5
View File
@@ -101,7 +101,7 @@ use constants::{currency::*, fee::*, time::*};
mod weights;
// Voter bag threshold definitions.
mod voter_bags;
mod bag_thresholds;
#[cfg(test)]
mod tests;
@@ -393,7 +393,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
}
parameter_types! {
pub const BagThresholds: &'static [u64] = &voter_bags::THRESHOLDS;
pub const BagThresholds: &'static [u64] = &bag_thresholds::THRESHOLDS;
}
impl pallet_bags_list::Config for Runtime {
@@ -453,8 +453,7 @@ impl pallet_staking::Config for Runtime {
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
// Use the nominators map to iter voters, but also perform the bags-list migration and keep
// it up-to-date.
// Use the nominators map to iter voters, but also keep bags-list up-to-date.
type SortedListProvider = runtime_common::elections::UseNominatorsAndUpdateBagsList<Runtime>;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}
@@ -751,7 +750,8 @@ impl InstanceFilter<Call> for ProxyType {
Call::Registrar(paras_registrar::Call::reserve{..}) |
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) // Specifically omitting the entire XCM Pallet
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::BagsList(..)
),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))