Ensure pallet-session is initialized after staking

This commit is contained in:
Luke Parker 2023-10-22 02:52:34 -04:00
parent c3fdb9d9df
commit d29d19bdfe
No known key found for this signature in database
2 changed files with 15 additions and 15 deletions

View file

@ -47,9 +47,9 @@ pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", d
coins-pallet = { package = "serai-coins-pallet", path = "../coins/pallet", default-features = false } coins-pallet = { package = "serai-coins-pallet", path = "../coins/pallet", default-features = false }
pallet-session = { git = "https://github.com/serai-dex/substrate", default-features = false }
validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets/pallet", default-features = false } validator-sets-pallet = { package = "serai-validator-sets-pallet", path = "../validator-sets/pallet", default-features = false }
staking-pallet = { package = "serai-staking-pallet", path = "../staking/pallet", default-features = false } staking-pallet = { package = "serai-staking-pallet", path = "../staking/pallet", default-features = false }
pallet-session = { git = "https://github.com/serai-dex/substrate", default-features = false }
in-instructions-pallet = { package = "serai-in-instructions-pallet", path = "../in-instructions/pallet", default-features = false } in-instructions-pallet = { package = "serai-in-instructions-pallet", path = "../in-instructions/pallet", default-features = false }
@ -102,9 +102,9 @@ std = [
"coins-pallet/std", "coins-pallet/std",
"pallet-session/std",
"validator-sets-pallet/std", "validator-sets-pallet/std",
"staking-pallet/std", "staking-pallet/std",
"pallet-session/std",
"in-instructions-pallet/std", "in-instructions-pallet/std",

View file

@ -18,9 +18,9 @@ pub use pallet_transaction_payment as transaction_payment;
pub use coins_pallet as coins; pub use coins_pallet as coins;
pub use pallet_session as session;
pub use staking_pallet as staking; pub use staking_pallet as staking;
pub use validator_sets_pallet as validator_sets; pub use validator_sets_pallet as validator_sets;
pub use pallet_session as session;
pub use in_instructions_pallet as in_instructions; pub use in_instructions_pallet as in_instructions;
@ -166,12 +166,6 @@ impl Contains<RuntimeCall> for CallFilter {
timestamp::Call::__Ignore(_, _) => false, timestamp::Call::__Ignore(_, _) => false,
}, },
RuntimeCall::Session(call) => match call {
session::Call::set_keys { .. } => true,
session::Call::purge_keys { .. } => true,
session::Call::__Ignore(_, _) => false,
},
// All of these pallets are our own, and all of their written calls are intended to be called // All of these pallets are our own, and all of their written calls are intended to be called
RuntimeCall::Coins(call) => !matches!(call, coins::Call::__Ignore(_, _)), RuntimeCall::Coins(call) => !matches!(call, coins::Call::__Ignore(_, _)),
RuntimeCall::ValidatorSets(call) => !matches!(call, validator_sets::Call::__Ignore(_, _)), RuntimeCall::ValidatorSets(call) => !matches!(call, validator_sets::Call::__Ignore(_, _)),
@ -179,6 +173,12 @@ impl Contains<RuntimeCall> for CallFilter {
RuntimeCall::InInstructions(call) => !matches!(call, in_instructions::Call::__Ignore(_, _)), RuntimeCall::InInstructions(call) => !matches!(call, in_instructions::Call::__Ignore(_, _)),
RuntimeCall::Signals(call) => !matches!(call, signals::Call::__Ignore(_, _)), RuntimeCall::Signals(call) => !matches!(call, signals::Call::__Ignore(_, _)),
RuntimeCall::Session(call) => match call {
session::Call::set_keys { .. } => true,
session::Call::purge_keys { .. } => false,
session::Call::__Ignore(_, _) => false,
},
RuntimeCall::Babe(call) => match call { RuntimeCall::Babe(call) => match call {
babe::Call::report_equivocation { .. } => true, babe::Call::report_equivocation { .. } => true,
babe::Call::report_equivocation_unsigned { .. } => true, babe::Call::report_equivocation_unsigned { .. } => true,
@ -245,6 +245,11 @@ impl coins::Config for Runtime {
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
} }
impl validator_sets::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
impl staking::Config for Runtime {}
pub struct IdentityValidatorIdOf; pub struct IdentityValidatorIdOf;
impl Convert<PublicKey, Option<PublicKey>> for IdentityValidatorIdOf { impl Convert<PublicKey, Option<PublicKey>> for IdentityValidatorIdOf {
fn convert(key: PublicKey) -> Option<PublicKey> { fn convert(key: PublicKey) -> Option<PublicKey> {
@ -264,11 +269,6 @@ impl session::Config for Runtime {
type WeightInfo = session::weights::SubstrateWeight<Runtime>; type WeightInfo = session::weights::SubstrateWeight<Runtime>;
} }
impl validator_sets::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
impl staking::Config for Runtime {}
impl signals::Config for Runtime { impl signals::Config for Runtime {
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
// 1 week // 1 week
@ -346,9 +346,9 @@ construct_runtime!(
Coins: coins, Coins: coins,
Session: session,
ValidatorSets: validator_sets, ValidatorSets: validator_sets,
Staking: staking, Staking: staking,
Session: session,
InInstructions: in_instructions, InInstructions: in_instructions,