Kitchensink chain: Add BEEFY support (#2856)

Related to https://github.com/paritytech/polkadot-sdk/issues/2787

Adding BEEFY support to the kitchensink chain in order to be able to
extend the current warp sync zombienet tests with BEEFY enabled
This commit is contained in:
Serban Iorga
2024-01-06 12:18:38 +01:00
committed by GitHub
parent 930c151928
commit 2e4b8996c4
14 changed files with 320 additions and 93 deletions
+5 -8
View File
@@ -24,7 +24,7 @@ use kitchensink_runtime::{
GrandpaConfig, IndicesConfig, RuntimeGenesisConfig, SessionConfig, SocietyConfig, StakerStatus,
StakingConfig, BABE_GENESIS_EPOCH_CONFIG,
};
use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use sp_keyring::Ed25519Keyring;
use sp_runtime::Perbill;
/// Create genesis runtime configuration for tests.
@@ -52,13 +52,9 @@ pub fn config_endowed(extra_endowed: Vec<AccountId>) -> RuntimeGenesisConfig {
balances: BalancesConfig { balances: endowed },
session: SessionConfig {
keys: vec![
(alice(), dave(), to_session_keys(&Ed25519Keyring::Alice, &Sr25519Keyring::Alice)),
(bob(), eve(), to_session_keys(&Ed25519Keyring::Bob, &Sr25519Keyring::Bob)),
(
charlie(),
ferdie(),
to_session_keys(&Ed25519Keyring::Charlie, &Sr25519Keyring::Charlie),
),
(alice(), dave(), session_keys_from_seed(Ed25519Keyring::Alice.into())),
(bob(), eve(), session_keys_from_seed(Ed25519Keyring::Bob.into())),
(charlie(), ferdie(), session_keys_from_seed(Ed25519Keyring::Charlie.into())),
],
},
staking: StakingConfig {
@@ -79,6 +75,7 @@ pub fn config_endowed(extra_endowed: Vec<AccountId>) -> RuntimeGenesisConfig {
..Default::default()
},
grandpa: GrandpaConfig { authorities: vec![], _config: Default::default() },
beefy: Default::default(),
im_online: Default::default(),
authority_discovery: Default::default(),
democracy: Default::default(),
+10 -10
View File
@@ -20,8 +20,10 @@
use codec::Encode;
use kitchensink_runtime::{CheckedExtrinsic, SessionKeys, SignedExtra, UncheckedExtrinsic};
use node_cli::chain_spec::get_from_seed;
use node_primitives::{AccountId, Balance, Nonce};
use sp_keyring::{AccountKeyring, Ed25519Keyring, Sr25519Keyring};
use sp_core::{ecdsa, ed25519, sr25519};
use sp_keyring::AccountKeyring;
use sp_runtime::generic::Era;
/// Alice's account id.
@@ -55,16 +57,14 @@ pub fn ferdie() -> AccountId {
}
/// Convert keyrings into `SessionKeys`.
pub fn to_session_keys(
ed25519_keyring: &Ed25519Keyring,
sr25519_keyring: &Sr25519Keyring,
) -> SessionKeys {
pub fn session_keys_from_seed(seed: &str) -> SessionKeys {
SessionKeys {
grandpa: ed25519_keyring.to_owned().public().into(),
babe: sr25519_keyring.to_owned().public().into(),
im_online: sr25519_keyring.to_owned().public().into(),
authority_discovery: sr25519_keyring.to_owned().public().into(),
mixnet: sr25519_keyring.to_owned().public().into(),
grandpa: get_from_seed::<ed25519::Public>(seed).into(),
babe: get_from_seed::<sr25519::Public>(seed).into(),
im_online: get_from_seed::<sr25519::Public>(seed).into(),
authority_discovery: get_from_seed::<sr25519::Public>(seed).into(),
mixnet: get_from_seed::<sr25519::Public>(seed).into(),
beefy: get_from_seed::<ecdsa::Public>(seed).into(),
}
}