Companion for 12095 (#5924)

* Companion for 12095

* fix

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Kian Paimani
2022-08-28 14:41:43 +01:00
committed by GitHub
parent 5595c96d03
commit 2d8177cf70
5 changed files with 197 additions and 175 deletions
+171 -170
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -489,6 +489,9 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OffchainRepeat = OffchainRepeat; type OffchainRepeat = OffchainRepeat;
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
#[cfg(feature = "fast-runtime")]
type Fallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
#[cfg(not(feature = "fast-runtime"))]
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>; type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>; type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen< type Solver = SequentialPhragmen<
@@ -582,7 +585,7 @@ impl pallet_staking::EraPayout<Balance> for EraPayout {
parameter_types! { parameter_types! {
// Six sessions in an era (6 hours). // Six sessions in an era (6 hours).
pub const SessionsPerEra: SessionIndex = 6; pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);
// 28 eras for unbonding (7 days). // 28 eras for unbonding (7 days).
pub const BondingDuration: sp_staking::EraIndex = 28; pub const BondingDuration: sp_staking::EraIndex = 28;
// 27 eras in which slashes can be cancelled (slightly less than 7 days). // 27 eras in which slashes can be cancelled (slightly less than 7 days).
@@ -1868,7 +1871,7 @@ sp_api::impl_runtime_apis! {
Balance, Balance,
> for Runtime { > for Runtime {
fn pending_rewards(member: AccountId) -> Balance { fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member) NominationPools::pending_rewards(member).unwrap_or_default()
} }
} }
+2
View File
@@ -55,6 +55,7 @@ pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "ma
pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -145,6 +146,7 @@ std = [
"pallet-membership/std", "pallet-membership/std",
"pallet-multisig/std", "pallet-multisig/std",
"pallet-nomination-pools/std", "pallet-nomination-pools/std",
"pallet-nomination-pools-runtime-api/std",
"pallet-offences/std", "pallet-offences/std",
"pallet-preimage/std", "pallet-preimage/std",
"pallet-proxy/std", "pallet-proxy/std",
+14 -1
View File
@@ -526,6 +526,9 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OffchainRepeat = OffchainRepeat; type OffchainRepeat = OffchainRepeat;
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
#[cfg(feature = "fast-runtime")]
type Fallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
#[cfg(not(feature = "fast-runtime"))]
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>; type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>; type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen< type Solver = SequentialPhragmen<
@@ -573,7 +576,7 @@ pallet_staking_reward_curve::build! {
parameter_types! { parameter_types! {
// Six sessions in an era (24 hours). // Six sessions in an era (24 hours).
pub const SessionsPerEra: SessionIndex = 6; pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);
// 28 eras for unbonding (28 days). // 28 eras for unbonding (28 days).
pub const BondingDuration: sp_staking::EraIndex = 28; pub const BondingDuration: sp_staking::EraIndex = 28;
pub const SlashDeferDuration: sp_staking::EraIndex = 27; pub const SlashDeferDuration: sp_staking::EraIndex = 27;
@@ -1673,6 +1676,16 @@ sp_api::impl_runtime_apis! {
} }
} }
impl pallet_nomination_pools_runtime_api::NominationPoolsApi<
Block,
AccountId,
Balance,
> for Runtime {
fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member).unwrap_or_default()
}
}
impl tx_pool_api::runtime_api::TaggedTransactionQueue<Block> for Runtime { impl tx_pool_api::runtime_api::TaggedTransactionQueue<Block> for Runtime {
fn validate_transaction( fn validate_transaction(
source: TransactionSource, source: TransactionSource,
+5 -2
View File
@@ -437,6 +437,9 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OffchainRepeat = OffchainRepeat; type OffchainRepeat = OffchainRepeat;
type MinerTxPriority = NposSolutionPriority; type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking; type DataProvider = Staking;
#[cfg(feature = "fast-runtime")]
type Fallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
#[cfg(not(feature = "fast-runtime"))]
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>; type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>; type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen< type Solver = SequentialPhragmen<
@@ -476,7 +479,7 @@ pallet_staking_reward_curve::build! {
parameter_types! { parameter_types! {
// Six sessions in an era (6 hours). // Six sessions in an era (6 hours).
pub const SessionsPerEra: SessionIndex = 6; pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);
// 2 eras for unbonding (12 hours). // 2 eras for unbonding (12 hours).
pub const BondingDuration: sp_staking::EraIndex = 2; pub const BondingDuration: sp_staking::EraIndex = 2;
// 1 era in which slashes can be cancelled (6 hours). // 1 era in which slashes can be cancelled (6 hours).
@@ -1578,7 +1581,7 @@ sp_api::impl_runtime_apis! {
Balance, Balance,
> for Runtime { > for Runtime {
fn pending_rewards(member: AccountId) -> Balance { fn pending_rewards(member: AccountId) -> Balance {
NominationPools::pending_rewards(member) NominationPools::pending_rewards(member).unwrap_or_default()
} }
} }