Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Companion for Soft deprecate GenesisConfig (#2636)
Browse files Browse the repository at this point in the history
* update genesis config

* rebase and fix errors

---------

Co-authored-by: parity-processbot <>
Co-authored-by: joepetrowski <joe@parity.io>
  • Loading branch information
juangirini and joepetrowski authored Jun 16, 2023
1 parent 92c84e8 commit 645326a
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 60 deletions.
6 changes: 3 additions & 3 deletions parachain-template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!")
Expand Down
20 changes: 10 additions & 10 deletions parachains/integration-tests/emulated/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down
18 changes: 9 additions & 9 deletions polkadot-parachain/src/chain_spec/asset_hubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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!")
Expand Down
18 changes: 9 additions & 9 deletions polkadot-parachain/src/chain_spec/bridge_hubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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!")
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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!")
Expand Down
6 changes: 3 additions & 3 deletions polkadot-parachain/src/chain_spec/collectives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!")
Expand Down
6 changes: 3 additions & 3 deletions polkadot-parachain/src/chain_spec/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!")
Expand Down
6 changes: 3 additions & 3 deletions polkadot-parachain/src/chain_spec/glutton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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!")
Expand Down
7 changes: 4 additions & 3 deletions polkadot-parachain/src/chain_spec/penpal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!")
Expand Down
6 changes: 3 additions & 3 deletions polkadot-parachain/src/chain_spec/rococo_parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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!")
Expand Down
6 changes: 3 additions & 3 deletions polkadot-parachain/src/chain_spec/seedling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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!")
Expand Down
7 changes: 4 additions & 3 deletions polkadot-parachain/src/chain_spec/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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!")
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions test/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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())
}

Expand Down
Loading

0 comments on commit 645326a

Please sign in to comment.