Companion for Soft deprecate GenesisConfig (#2636)

* update genesis config

* rebase and fix errors

---------

Co-authored-by: parity-processbot <>
Co-authored-by: joepetrowski <joe@parity.io>
This commit is contained in:
Juan
2023-06-16 13:05:45 +02:00
committed by GitHub
parent 185d376446
commit d77a8826d1
14 changed files with 62 additions and 60 deletions
@@ -8,7 +8,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<parachain_template_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<parachain_template_runtime::RuntimeGenesisConfig, Extensions>;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
@@ -181,8 +181,8 @@ fn testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> parachain_template_runtime::GenesisConfig {
parachain_template_runtime::GenesisConfig {
) -> parachain_template_runtime::RuntimeGenesisConfig {
parachain_template_runtime::RuntimeGenesisConfig {
system: parachain_template_runtime::SystemConfig {
code: parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -150,7 +150,7 @@ pub mod polkadot {
}
pub fn genesis() -> Storage {
let genesis_config = polkadot_runtime::GenesisConfig {
let genesis_config = polkadot_runtime::RuntimeGenesisConfig {
system: polkadot_runtime::SystemConfig {
code: polkadot_runtime::WASM_BINARY.unwrap().to_vec(),
},
@@ -246,7 +246,7 @@ pub mod westend {
}
pub fn genesis() -> Storage {
let genesis_config = westend_runtime::GenesisConfig {
let genesis_config = westend_runtime::RuntimeGenesisConfig {
system: westend_runtime::SystemConfig {
code: westend_runtime::WASM_BINARY.unwrap().to_vec(),
},
@@ -343,7 +343,7 @@ pub mod kusama {
}
pub fn genesis() -> Storage {
let genesis_config = kusama_runtime::GenesisConfig {
let genesis_config = kusama_runtime::RuntimeGenesisConfig {
system: kusama_runtime::SystemConfig {
code: kusama_runtime::WASM_BINARY.unwrap().to_vec(),
},
@@ -408,7 +408,7 @@ pub mod asset_hub_polkadot {
pub const ED: Balance = asset_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = asset_hub_polkadot_runtime::GenesisConfig {
let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig {
system: asset_hub_polkadot_runtime::SystemConfig {
code: asset_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -464,7 +464,7 @@ pub mod asset_hub_westend {
pub const ED: Balance = asset_hub_westend_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = asset_hub_westend_runtime::GenesisConfig {
let genesis_config = asset_hub_westend_runtime::RuntimeGenesisConfig {
system: asset_hub_westend_runtime::SystemConfig {
code: asset_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -520,7 +520,7 @@ pub mod asset_hub_kusama {
pub const ED: Balance = asset_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = asset_hub_kusama_runtime::GenesisConfig {
let genesis_config = asset_hub_kusama_runtime::RuntimeGenesisConfig {
system: asset_hub_kusama_runtime::SystemConfig {
code: asset_hub_kusama_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -576,7 +576,7 @@ pub mod penpal {
pub const ED: Balance = penpal_runtime::EXISTENTIAL_DEPOSIT;
pub fn genesis(para_id: u32) -> Storage {
let genesis_config = penpal_runtime::GenesisConfig {
let genesis_config = penpal_runtime::RuntimeGenesisConfig {
system: penpal_runtime::SystemConfig {
code: penpal_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -633,7 +633,7 @@ pub mod collectives {
pub const ED: Balance = collectives_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = collectives_polkadot_runtime::GenesisConfig {
let genesis_config = collectives_polkadot_runtime::RuntimeGenesisConfig {
system: collectives_polkadot_runtime::SystemConfig {
code: collectives_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -692,7 +692,7 @@ pub mod bridge_hub_kusama {
pub const ED: Balance = bridge_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = bridge_hub_kusama_runtime::GenesisConfig {
let genesis_config = bridge_hub_kusama_runtime::RuntimeGenesisConfig {
system: bridge_hub_kusama_runtime::SystemConfig {
code: bridge_hub_kusama_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -747,7 +747,7 @@ pub mod bridge_hub_polkadot {
pub const ED: Balance = bridge_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
pub fn genesis() -> Storage {
let genesis_config = bridge_hub_polkadot_runtime::GenesisConfig {
let genesis_config = bridge_hub_polkadot_runtime::RuntimeGenesisConfig {
system: bridge_hub_polkadot_runtime::SystemConfig {
code: bridge_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -25,11 +25,11 @@ use sp_core::{crypto::UncheckedInto, sr25519};
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type AssetHubPolkadotChainSpec =
sc_service::GenericChainSpec<asset_hub_polkadot_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<asset_hub_polkadot_runtime::RuntimeGenesisConfig, Extensions>;
pub type AssetHubKusamaChainSpec =
sc_service::GenericChainSpec<asset_hub_kusama_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<asset_hub_kusama_runtime::RuntimeGenesisConfig, Extensions>;
pub type AssetHubWestendChainSpec =
sc_service::GenericChainSpec<asset_hub_westend_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<asset_hub_westend_runtime::RuntimeGenesisConfig, Extensions>;
const ASSET_HUB_POLKADOT_ED: AssetHubBalance =
asset_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
@@ -213,8 +213,8 @@ fn asset_hub_polkadot_genesis(
invulnerables: Vec<(AccountId, AssetHubPolkadotAuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> asset_hub_polkadot_runtime::GenesisConfig {
asset_hub_polkadot_runtime::GenesisConfig {
) -> asset_hub_polkadot_runtime::RuntimeGenesisConfig {
asset_hub_polkadot_runtime::RuntimeGenesisConfig {
system: asset_hub_polkadot_runtime::SystemConfig {
code: asset_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -402,8 +402,8 @@ fn asset_hub_kusama_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> asset_hub_kusama_runtime::GenesisConfig {
asset_hub_kusama_runtime::GenesisConfig {
) -> asset_hub_kusama_runtime::RuntimeGenesisConfig {
asset_hub_kusama_runtime::RuntimeGenesisConfig {
system: asset_hub_kusama_runtime::SystemConfig {
code: asset_hub_kusama_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -586,8 +586,8 @@ fn asset_hub_westend_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> asset_hub_westend_runtime::GenesisConfig {
asset_hub_westend_runtime::GenesisConfig {
) -> asset_hub_westend_runtime::RuntimeGenesisConfig {
asset_hub_westend_runtime::RuntimeGenesisConfig {
system: asset_hub_westend_runtime::SystemConfig {
code: asset_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -217,7 +217,7 @@ pub mod rococo {
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type BridgeHubChainSpec =
sc_service::GenericChainSpec<bridge_hub_rococo_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<bridge_hub_rococo_runtime::RuntimeGenesisConfig, Extensions>;
pub type RuntimeApi = bridge_hub_rococo_runtime::RuntimeApi;
@@ -289,8 +289,8 @@ pub mod rococo {
endowed_accounts: Vec<AccountId>,
id: ParaId,
bridges_pallet_owner: Option<AccountId>,
) -> bridge_hub_rococo_runtime::GenesisConfig {
bridge_hub_rococo_runtime::GenesisConfig {
) -> bridge_hub_rococo_runtime::RuntimeGenesisConfig {
bridge_hub_rococo_runtime::RuntimeGenesisConfig {
system: bridge_hub_rococo_runtime::SystemConfig {
code: bridge_hub_rococo_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -392,7 +392,7 @@ pub mod kusama {
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type BridgeHubChainSpec =
sc_service::GenericChainSpec<bridge_hub_kusama_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<bridge_hub_kusama_runtime::RuntimeGenesisConfig, Extensions>;
pub type RuntimeApi = bridge_hub_kusama_runtime::RuntimeApi;
pub fn local_config(
@@ -455,8 +455,8 @@ pub mod kusama {
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> bridge_hub_kusama_runtime::GenesisConfig {
bridge_hub_kusama_runtime::GenesisConfig {
) -> bridge_hub_kusama_runtime::RuntimeGenesisConfig {
bridge_hub_kusama_runtime::RuntimeGenesisConfig {
system: bridge_hub_kusama_runtime::SystemConfig {
code: bridge_hub_kusama_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -524,7 +524,7 @@ pub mod polkadot {
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type BridgeHubChainSpec =
sc_service::GenericChainSpec<bridge_hub_polkadot_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<bridge_hub_polkadot_runtime::RuntimeGenesisConfig, Extensions>;
pub type RuntimeApi = bridge_hub_polkadot_runtime::RuntimeApi;
pub fn local_config(
@@ -587,8 +587,8 @@ pub mod polkadot {
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> bridge_hub_polkadot_runtime::GenesisConfig {
bridge_hub_polkadot_runtime::GenesisConfig {
) -> bridge_hub_polkadot_runtime::RuntimeGenesisConfig {
bridge_hub_polkadot_runtime::RuntimeGenesisConfig {
system: bridge_hub_polkadot_runtime::SystemConfig {
code: bridge_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -23,7 +23,7 @@ use sc_service::ChainType;
use sp_core::sr25519;
pub type CollectivesPolkadotChainSpec =
sc_service::GenericChainSpec<collectives_polkadot_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<collectives_polkadot_runtime::RuntimeGenesisConfig, Extensions>;
const COLLECTIVES_POLKADOT_ED: CollectivesBalance =
collectives_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
@@ -132,8 +132,8 @@ fn collectives_polkadot_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> collectives_polkadot_runtime::GenesisConfig {
collectives_polkadot_runtime::GenesisConfig {
) -> collectives_polkadot_runtime::RuntimeGenesisConfig {
collectives_polkadot_runtime::RuntimeGenesisConfig {
system: collectives_polkadot_runtime::SystemConfig {
code: collectives_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -24,7 +24,7 @@ use sc_service::ChainType;
use sp_core::{crypto::UncheckedInto, sr25519};
pub type ContractsRococoChainSpec =
sc_service::GenericChainSpec<contracts_rococo_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<contracts_rococo_runtime::RuntimeGenesisConfig, Extensions>;
/// No relay chain suffix because the id is the same over all relay chains.
const CONTRACTS_PARACHAIN_ID: u32 = 1002;
@@ -234,8 +234,8 @@ fn contracts_rococo_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> contracts_rococo_runtime::GenesisConfig {
contracts_rococo_runtime::GenesisConfig {
) -> contracts_rococo_runtime::RuntimeGenesisConfig {
contracts_rococo_runtime::RuntimeGenesisConfig {
system: contracts_rococo_runtime::SystemConfig {
code: contracts_rococo_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -21,7 +21,7 @@ use sp_core::sr25519;
/// Specialized `ChainSpec` for the Glutton parachain runtime.
pub type GluttonChainSpec =
sc_service::GenericChainSpec<glutton_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<glutton_runtime::RuntimeGenesisConfig, Extensions>;
pub fn glutton_development_config(para_id: ParaId) -> GluttonChainSpec {
GluttonChainSpec::from_genesis(
@@ -78,8 +78,8 @@ pub fn glutton_config(para_id: ParaId) -> GluttonChainSpec {
)
}
fn glutton_genesis(parachain_id: ParaId) -> glutton_runtime::GenesisConfig {
glutton_runtime::GenesisConfig {
fn glutton_genesis(parachain_id: ParaId) -> glutton_runtime::RuntimeGenesisConfig {
glutton_runtime::RuntimeGenesisConfig {
system: glutton_runtime::SystemConfig {
code: glutton_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -22,7 +22,8 @@ use parachains_common::{AccountId, AuraId};
use sc_service::ChainType;
use sp_core::sr25519;
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type PenpalChainSpec = sc_service::GenericChainSpec<penpal_runtime::GenesisConfig, Extensions>;
pub type PenpalChainSpec =
sc_service::GenericChainSpec<penpal_runtime::RuntimeGenesisConfig, Extensions>;
pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> PenpalChainSpec {
// Give your base currency a unit name and decimal places
@@ -83,8 +84,8 @@ fn penpal_testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> penpal_runtime::GenesisConfig {
penpal_runtime::GenesisConfig {
) -> penpal_runtime::RuntimeGenesisConfig {
penpal_runtime::RuntimeGenesisConfig {
system: penpal_runtime::SystemConfig {
code: penpal_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -26,7 +26,7 @@ use sc_chain_spec::ChainType;
use sp_core::{crypto::UncheckedInto, sr25519};
pub type RococoParachainChainSpec =
sc_service::GenericChainSpec<rococo_parachain_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<rococo_parachain_runtime::RuntimeGenesisConfig, Extensions>;
pub fn rococo_parachain_local_config() -> RococoParachainChainSpec {
RococoParachainChainSpec::from_genesis(
@@ -99,8 +99,8 @@ pub(crate) fn testnet_genesis(
initial_authorities: Vec<AuraId>,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> rococo_parachain_runtime::GenesisConfig {
rococo_parachain_runtime::GenesisConfig {
) -> rococo_parachain_runtime::RuntimeGenesisConfig {
rococo_parachain_runtime::RuntimeGenesisConfig {
system: rococo_parachain_runtime::SystemConfig {
code: rococo_parachain_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -22,7 +22,7 @@ use sp_core::sr25519;
/// Specialized `ChainSpec` for the seedling parachain runtime.
pub type SeedlingChainSpec =
sc_service::GenericChainSpec<seedling_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<seedling_runtime::RuntimeGenesisConfig, Extensions>;
pub fn get_seedling_chain_spec() -> SeedlingChainSpec {
SeedlingChainSpec::from_genesis(
@@ -47,8 +47,8 @@ pub fn get_seedling_chain_spec() -> SeedlingChainSpec {
fn seedling_testnet_genesis(
root_key: AccountId,
parachain_id: ParaId,
) -> seedling_runtime::GenesisConfig {
seedling_runtime::GenesisConfig {
) -> seedling_runtime::RuntimeGenesisConfig {
seedling_runtime::RuntimeGenesisConfig {
system: seedling_runtime::SystemConfig {
code: seedling_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
@@ -19,7 +19,8 @@ use cumulus_primitives_core::ParaId;
use sc_service::ChainType;
/// Specialized `ChainSpec` for the shell parachain runtime.
pub type ShellChainSpec = sc_service::GenericChainSpec<shell_runtime::GenesisConfig, Extensions>;
pub type ShellChainSpec =
sc_service::GenericChainSpec<shell_runtime::RuntimeGenesisConfig, Extensions>;
pub fn get_shell_chain_spec() -> ShellChainSpec {
ShellChainSpec::from_genesis(
@@ -36,8 +37,8 @@ pub fn get_shell_chain_spec() -> ShellChainSpec {
)
}
fn shell_testnet_genesis(parachain_id: ParaId) -> shell_runtime::GenesisConfig {
shell_runtime::GenesisConfig {
fn shell_testnet_genesis(parachain_id: ParaId) -> shell_runtime::RuntimeGenesisConfig {
shell_runtime::RuntimeGenesisConfig {
system: shell_runtime::SystemConfig {
code: shell_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
+1 -1
View File
@@ -1244,7 +1244,7 @@ mod tests {
}
pub type DummyChainSpec<E> =
sc_service::GenericChainSpec<rococo_parachain_runtime::GenesisConfig, E>;
sc_service::GenericChainSpec<rococo_parachain_runtime::RuntimeGenesisConfig, E>;
pub fn create_default_with_extensions<E: Extension>(
id: &str,
+3 -3
View File
@@ -19,8 +19,8 @@
mod block_builder;
use codec::{Decode, Encode};
use runtime::{
Balance, Block, BlockHashCount, GenesisConfig, Runtime, RuntimeCall, Signature, SignedExtra,
SignedPayload, UncheckedExtrinsic, VERSION,
Balance, Block, BlockHashCount, Runtime, RuntimeCall, RuntimeGenesisConfig, Signature,
SignedExtra, SignedPayload, UncheckedExtrinsic, VERSION,
};
use sc_executor::HeapAllocStrategy;
use sc_executor_common::runtime_blob::RuntimeBlob;
@@ -124,7 +124,7 @@ impl DefaultTestClientBuilderExt for TestClientBuilder {
}
}
fn genesis_config() -> GenesisConfig {
fn genesis_config() -> RuntimeGenesisConfig {
cumulus_test_service::testnet_genesis_with_default_endowed(Default::default())
}
+4 -4
View File
@@ -31,7 +31,7 @@ pub type ChainSpec = sc_service::GenericChainSpec<GenesisExt, Extensions>;
#[derive(serde::Serialize, serde::Deserialize)]
pub struct GenesisExt {
/// The runtime genesis config.
runtime_genesis_config: cumulus_test_runtime::GenesisConfig,
runtime_genesis_config: cumulus_test_runtime::RuntimeGenesisConfig,
/// The parachain id.
para_id: ParaId,
}
@@ -113,7 +113,7 @@ pub fn get_chain_spec(id: ParaId) -> ChainSpec {
/// Local testnet genesis for testing.
pub fn testnet_genesis_with_default_endowed(
mut extra_endowed_accounts: Vec<AccountId>,
) -> cumulus_test_runtime::GenesisConfig {
) -> cumulus_test_runtime::RuntimeGenesisConfig {
let mut endowed = vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
@@ -137,8 +137,8 @@ pub fn testnet_genesis_with_default_endowed(
pub fn testnet_genesis(
root_key: AccountId,
endowed_accounts: Vec<AccountId>,
) -> cumulus_test_runtime::GenesisConfig {
cumulus_test_runtime::GenesisConfig {
) -> cumulus_test_runtime::RuntimeGenesisConfig {
cumulus_test_runtime::RuntimeGenesisConfig {
system: cumulus_test_runtime::SystemConfig {
code: cumulus_test_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")