Companion for #9648 (#3757)

* make the companion

* update Substrate

Co-authored-by: parity-processbot <>
This commit is contained in:
Kian Paimani
2021-09-12 16:23:07 +01:00
committed by GitHub
parent a2cea3a314
commit 3d2c4db477
7 changed files with 189 additions and 190 deletions
+9 -11
View File
@@ -350,9 +350,6 @@ parameter_types! {
pub const SignedDepositByte: Balance = deposit(0, 10) / 1024;
// Each good submission will get 1/10 KSM as reward
pub SignedRewardBase: Balance = UNITS / 10;
// fallback: emergency phase.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
pallet_election_provider_multi_phase::FallbackStrategy::Nothing;
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(5u32, 10_000);
// miner configs
@@ -389,11 +386,10 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking;
type Solution = NposCompactSolution24;
type OnChainAccuracy = Perbill;
type Fallback = Fallback;
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type Solver = frame_election_provider_support::SequentialPhragmen<
AccountId,
pallet_election_provider_multi_phase::SolutionAccuracyOf<Runtime>,
pallet_election_provider_multi_phase::SolutionAccuracyOf<Self>,
runtime_common::elections::OffchainRandomBalancing,
>;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
@@ -402,7 +398,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
>;
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Runtime>;
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Self>;
}
fn era_payout(
@@ -483,6 +479,11 @@ type SlashCancelOrigin = EnsureOneOf<
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>,
>;
impl frame_election_provider_support::onchain::Config for Runtime {
type Accuracy = runtime_common::elections::OnOnChainAccuracy;
type DataProvider = Staking;
}
impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 =
<NposCompactSolution24 as sp_npos_elections::NposSolution>::LIMIT as u32;
@@ -490,10 +491,7 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider =
frame_election_provider_support::onchain::OnChainSequentialPhragmen<
pallet_election_provider_multi_phase::OnChainConfig<Self>,
>;
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
type RewardRemainder = Treasury;
type Event = Event;
type Slash = Treasury;