diff --git a/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs
index a8d3d2975adab..2988d6af0d13e 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs
@@ -15,7 +15,8 @@
// along with Cumulus. If not, see .
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
@@ -23,16 +24,6 @@ use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance as As
use sc_service::ChainType;
use sp_core::{crypto::UncheckedInto, sr25519};
-/// Specialized `ChainSpec` for the normal parachain runtime.
-pub type AssetHubPolkadotChainSpec =
- sc_service::GenericChainSpec;
-pub type AssetHubKusamaChainSpec =
- sc_service::GenericChainSpec;
-pub type AssetHubWestendChainSpec =
- sc_service::GenericChainSpec;
-pub type AssetHubRococoChainSpec =
- sc_service::GenericChainSpec;
-
const ASSET_HUB_POLKADOT_ED: AssetHubBalance =
parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
const ASSET_HUB_KUSAMA_ED: AssetHubBalance =
@@ -72,13 +63,13 @@ pub fn asset_hub_westend_session_keys(keys: AuraId) -> asset_hub_westend_runtime
asset_hub_westend_runtime::SessionKeys { aura: keys }
}
-pub fn asset_hub_polkadot_development_config() -> AssetHubPolkadotChainSpec {
+pub fn asset_hub_polkadot_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- AssetHubPolkadotChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "polkadot-dev".into(), para_id: 1000 },
@@ -104,13 +95,13 @@ pub fn asset_hub_polkadot_development_config() -> AssetHubPolkadotChainSpec {
.build()
}
-pub fn asset_hub_polkadot_local_config() -> AssetHubPolkadotChainSpec {
+pub fn asset_hub_polkadot_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- AssetHubPolkadotChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "polkadot-local".into(), para_id: 1000 },
@@ -152,13 +143,13 @@ pub fn asset_hub_polkadot_local_config() -> AssetHubPolkadotChainSpec {
}
// Not used for syncing, but just to determine the genesis values set for the upgrade from shell.
-pub fn asset_hub_polkadot_config() -> AssetHubPolkadotChainSpec {
+pub fn asset_hub_polkadot_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- AssetHubPolkadotChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "polkadot".into(), para_id: 1000 },
@@ -249,13 +240,13 @@ fn asset_hub_polkadot_genesis(
})
}
-pub fn asset_hub_kusama_development_config() -> AssetHubKusamaChainSpec {
+pub fn asset_hub_kusama_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
properties.insert("tokenSymbol".into(), "KSM".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubKusamaChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama-dev".into(), para_id: 1000 },
)
@@ -280,13 +271,13 @@ pub fn asset_hub_kusama_development_config() -> AssetHubKusamaChainSpec {
.build()
}
-pub fn asset_hub_kusama_local_config() -> AssetHubKusamaChainSpec {
+pub fn asset_hub_kusama_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
properties.insert("tokenSymbol".into(), "KSM".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubKusamaChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama-local".into(), para_id: 1000 },
)
@@ -325,13 +316,13 @@ pub fn asset_hub_kusama_local_config() -> AssetHubKusamaChainSpec {
.build()
}
-pub fn asset_hub_kusama_config() -> AssetHubKusamaChainSpec {
+pub fn asset_hub_kusama_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
properties.insert("tokenSymbol".into(), "KSM".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubKusamaChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama".into(), para_id: 1000 },
)
@@ -407,12 +398,12 @@ fn asset_hub_kusama_genesis(
})
}
-pub fn asset_hub_westend_development_config() -> AssetHubWestendChainSpec {
+pub fn asset_hub_westend_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubWestendChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend".into(), para_id: 1000 },
@@ -439,12 +430,12 @@ pub fn asset_hub_westend_development_config() -> AssetHubWestendChainSpec {
.build()
}
-pub fn asset_hub_westend_local_config() -> AssetHubWestendChainSpec {
+pub fn asset_hub_westend_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubWestendChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend-local".into(), para_id: 1000 },
@@ -485,12 +476,12 @@ pub fn asset_hub_westend_local_config() -> AssetHubWestendChainSpec {
.build()
}
-pub fn asset_hub_westend_config() -> AssetHubWestendChainSpec {
+pub fn asset_hub_westend_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- AssetHubWestendChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend".into(), para_id: 1000 },
@@ -569,7 +560,7 @@ fn asset_hub_westend_genesis(
})
}
-pub fn asset_hub_rococo_development_config() -> AssetHubRococoChainSpec {
+pub fn asset_hub_rococo_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
properties.insert("tokenSymbol".into(), "ROC".into());
@@ -587,8 +578,8 @@ fn asset_hub_rococo_like_development_config(
name: &str,
chain_id: &str,
para_id: u32,
-) -> AssetHubRococoChainSpec {
- AssetHubRococoChainSpec::builder(
+) -> GenericChainSpec {
+ GenericChainSpec::builder(
asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo-dev".into(), para_id },
)
@@ -614,7 +605,7 @@ fn asset_hub_rococo_like_development_config(
.build()
}
-pub fn asset_hub_rococo_local_config() -> AssetHubRococoChainSpec {
+pub fn asset_hub_rococo_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
properties.insert("tokenSymbol".into(), "ROC".into());
@@ -632,8 +623,8 @@ fn asset_hub_rococo_like_local_config(
name: &str,
chain_id: &str,
para_id: u32,
-) -> AssetHubRococoChainSpec {
- AssetHubRococoChainSpec::builder(
+) -> GenericChainSpec {
+ GenericChainSpec::builder(
asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo-local".into(), para_id },
)
@@ -673,12 +664,12 @@ fn asset_hub_rococo_like_local_config(
.build()
}
-pub fn asset_hub_rococo_genesis_config() -> AssetHubRococoChainSpec {
+pub fn asset_hub_rococo_genesis_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "ROC".into());
properties.insert("tokenDecimals".into(), 12.into());
let para_id = 1000;
- AssetHubRococoChainSpec::builder(
+ GenericChainSpec::builder(
asset_hub_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo".into(), para_id },
)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs
index eb253908f5fc4..377ceb20e1e01 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use crate::chain_spec::{get_account_id_from_seed, get_collator_keys_from_seed};
+use crate::chain_spec::{get_account_id_from_seed, get_collator_keys_from_seed, GenericChainSpec};
use cumulus_primitives_core::ParaId;
use parachains_common::Balance as BridgeHubBalance;
use sc_chain_spec::ChainSpec;
use sp_core::sr25519;
-use std::{path::PathBuf, str::FromStr};
+use std::str::FromStr;
/// Collects all supported BridgeHub configurations
#[derive(Debug, PartialEq)]
@@ -71,33 +71,11 @@ impl FromStr for BridgeHubRuntimeType {
impl BridgeHubRuntimeType {
pub const ID_PREFIX: &'static str = "bridge-hub";
- pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> {
- match self {
- BridgeHubRuntimeType::Polkadot |
- BridgeHubRuntimeType::PolkadotLocal |
- BridgeHubRuntimeType::PolkadotDevelopment =>
- Ok(Box::new(polkadot::BridgeHubChainSpec::from_json_file(path)?)),
- BridgeHubRuntimeType::Kusama |
- BridgeHubRuntimeType::KusamaLocal |
- BridgeHubRuntimeType::KusamaDevelopment =>
- Ok(Box::new(kusama::BridgeHubChainSpec::from_json_file(path)?)),
- BridgeHubRuntimeType::Westend |
- BridgeHubRuntimeType::WestendLocal |
- BridgeHubRuntimeType::WestendDevelopment =>
- Ok(Box::new(westend::BridgeHubChainSpec::from_json_file(path)?)),
- BridgeHubRuntimeType::Rococo |
- BridgeHubRuntimeType::RococoLocal |
- BridgeHubRuntimeType::RococoDevelopment =>
- Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)),
- }
- }
-
pub fn load_config(&self) -> Result, String> {
match self {
- BridgeHubRuntimeType::Polkadot =>
- Ok(Box::new(polkadot::BridgeHubChainSpec::from_json_bytes(
- &include_bytes!("../../chain-specs/bridge-hub-polkadot.json")[..],
- )?)),
+ BridgeHubRuntimeType::Polkadot => Ok(Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../../chain-specs/bridge-hub-polkadot.json")[..],
+ )?)),
BridgeHubRuntimeType::PolkadotLocal => Ok(Box::new(polkadot::local_config(
polkadot::BRIDGE_HUB_POLKADOT_LOCAL,
"Polkadot BridgeHub Local",
@@ -110,10 +88,9 @@ impl BridgeHubRuntimeType {
"polkadot-dev",
ParaId::new(1002),
))),
- BridgeHubRuntimeType::Kusama =>
- Ok(Box::new(kusama::BridgeHubChainSpec::from_json_bytes(
- &include_bytes!("../../chain-specs/bridge-hub-kusama.json")[..],
- )?)),
+ BridgeHubRuntimeType::Kusama => Ok(Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../../chain-specs/bridge-hub-kusama.json")[..],
+ )?)),
BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::local_config(
kusama::BRIDGE_HUB_KUSAMA_LOCAL,
"Kusama BridgeHub Local",
@@ -126,10 +103,9 @@ impl BridgeHubRuntimeType {
"kusama-dev",
ParaId::new(1003),
))),
- BridgeHubRuntimeType::Westend =>
- Ok(Box::new(westend::BridgeHubChainSpec::from_json_bytes(
- &include_bytes!("../../chain-specs/bridge-hub-westend.json")[..],
- )?)),
+ BridgeHubRuntimeType::Westend => Ok(Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../../chain-specs/bridge-hub-westend.json")[..],
+ )?)),
BridgeHubRuntimeType::WestendLocal => Ok(Box::new(westend::local_config(
westend::BRIDGE_HUB_WESTEND_LOCAL,
"Westend BridgeHub Local",
@@ -144,10 +120,9 @@ impl BridgeHubRuntimeType {
ParaId::new(1002),
Some("Bob".to_string()),
))),
- BridgeHubRuntimeType::Rococo =>
- Ok(Box::new(rococo::BridgeHubChainSpec::from_json_bytes(
- &include_bytes!("../../chain-specs/bridge-hub-rococo.json")[..],
- )?)),
+ BridgeHubRuntimeType::Rococo => Ok(Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../../chain-specs/bridge-hub-rococo.json")[..],
+ )?)),
BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config(
rococo::BRIDGE_HUB_ROCOCO_LOCAL,
"Rococo BridgeHub Local",
@@ -184,7 +159,7 @@ fn ensure_id(id: &str) -> Result<&str, String> {
/// Sub-module for Rococo setup
pub mod rococo {
use super::{get_account_id_from_seed, get_collator_keys_from_seed, sr25519, ParaId};
- use crate::chain_spec::{Extensions, SAFE_XCM_VERSION};
+ use crate::chain_spec::{Extensions, GenericChainSpec, SAFE_XCM_VERSION};
use parachains_common::{AccountId, AuraId};
use sc_chain_spec::ChainType;
@@ -196,9 +171,6 @@ pub mod rococo {
const BRIDGE_HUB_ROCOCO_ED: BridgeHubBalance =
parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT;
- /// Specialized `ChainSpec` for the normal parachain runtime.
- pub type BridgeHubChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
pub fn local_config(
id: &str,
chain_name: &str,
@@ -206,7 +178,7 @@ pub mod rococo {
para_id: ParaId,
bridges_pallet_owner_seed: Option,
modify_props: ModifyProperties,
- ) -> BridgeHubChainSpec {
+ ) -> GenericChainSpec {
// Rococo defaults
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
@@ -214,7 +186,7 @@ pub mod rococo {
properties.insert("tokenDecimals".into(), 12.into());
modify_props(&mut properties);
- BridgeHubChainSpec::builder(
+ GenericChainSpec::builder(
bridge_hub_rococo_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() },
@@ -303,7 +275,8 @@ pub mod rococo {
pub mod kusama {
use super::{BridgeHubBalance, ParaId};
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use parachains_common::{AccountId, AuraId};
use sc_chain_spec::ChainType;
@@ -315,21 +288,18 @@ pub mod kusama {
const BRIDGE_HUB_KUSAMA_ED: BridgeHubBalance =
parachains_common::kusama::currency::EXISTENTIAL_DEPOSIT;
- /// Specialized `ChainSpec` for the normal parachain runtime.
- pub type BridgeHubChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
pub fn local_config(
id: &str,
chain_name: &str,
relay_chain: &str,
para_id: ParaId,
- ) -> BridgeHubChainSpec {
+ ) -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
properties.insert("tokenSymbol".into(), "KSM".into());
properties.insert("tokenDecimals".into(), 12.into());
- BridgeHubChainSpec::builder(
+ GenericChainSpec::builder(
bridge_hub_kusama_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() },
@@ -411,7 +381,7 @@ pub mod kusama {
/// Sub-module for Westend setup.
pub mod westend {
use super::{get_account_id_from_seed, get_collator_keys_from_seed, sr25519, ParaId};
- use crate::chain_spec::{Extensions, SAFE_XCM_VERSION};
+ use crate::chain_spec::{Extensions, GenericChainSpec, SAFE_XCM_VERSION};
use parachains_common::{AccountId, AuraId};
use sc_chain_spec::ChainType;
@@ -423,22 +393,18 @@ pub mod westend {
const BRIDGE_HUB_WESTEND_ED: BridgeHubBalance =
parachains_common::westend::currency::EXISTENTIAL_DEPOSIT;
- /// Specialized `ChainSpec` for the normal parachain runtime.
- pub type BridgeHubChainSpec =
- sc_service::GenericChainSpec;
-
pub fn local_config(
id: &str,
chain_name: &str,
relay_chain: &str,
para_id: ParaId,
bridges_pallet_owner_seed: Option,
- ) -> BridgeHubChainSpec {
+ ) -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- BridgeHubChainSpec::builder(
+ GenericChainSpec::builder(
bridge_hub_westend_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!"),
Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() },
@@ -527,7 +493,8 @@ pub mod westend {
pub mod polkadot {
use super::{BridgeHubBalance, ParaId};
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use parachains_common::{AccountId, AuraId};
use sc_chain_spec::ChainType;
@@ -539,21 +506,18 @@ pub mod polkadot {
const BRIDGE_HUB_POLKADOT_ED: BridgeHubBalance =
parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
- /// Specialized `ChainSpec` for the normal parachain runtime.
- pub type BridgeHubChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
pub fn local_config(
id: &str,
chain_name: &str,
relay_chain: &str,
para_id: ParaId,
- ) -> BridgeHubChainSpec {
+ ) -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- BridgeHubChainSpec::builder(
+ GenericChainSpec::builder(
bridge_hub_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() },
diff --git a/cumulus/polkadot-parachain/src/chain_spec/collectives.rs b/cumulus/polkadot-parachain/src/chain_spec/collectives.rs
index 07bd742fa8e32..ac75a40ebdec2 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/collectives.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/collectives.rs
@@ -15,16 +15,14 @@
// along with Cumulus. If not, see .
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use cumulus_primitives_core::ParaId;
use parachains_common::{AccountId, AuraId, Balance as CollectivesBalance};
use sc_service::ChainType;
use sp_core::sr25519;
-pub type CollectivesPolkadotChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-pub type CollectivesWestendChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
const COLLECTIVES_POLKADOT_ED: CollectivesBalance =
parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
const COLLECTIVES_WESTEND_ED: CollectivesBalance =
@@ -39,13 +37,13 @@ pub fn collectives_polkadot_session_keys(
collectives_polkadot_runtime::SessionKeys { aura: keys }
}
-pub fn collectives_polkadot_development_config() -> CollectivesPolkadotChainSpec {
+pub fn collectives_polkadot_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- CollectivesPolkadotChainSpec::builder(
+ GenericChainSpec::builder(
collectives_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "polkadot-dev".into(), para_id: 1002 },
@@ -75,13 +73,13 @@ pub fn collectives_polkadot_development_config() -> CollectivesPolkadotChainSpec
}
/// Collectives Polkadot Local Config.
-pub fn collectives_polkadot_local_config() -> CollectivesPolkadotChainSpec {
+pub fn collectives_polkadot_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());
- CollectivesPolkadotChainSpec::builder(
+ GenericChainSpec::builder(
collectives_polkadot_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "polkadot-local".into(), para_id: 1002 },
@@ -169,13 +167,13 @@ pub fn collectives_westend_session_keys(keys: AuraId) -> collectives_westend_run
collectives_westend_runtime::SessionKeys { aura: keys }
}
-pub fn collectives_westend_development_config() -> CollectivesWestendChainSpec {
+pub fn collectives_westend_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- CollectivesWestendChainSpec::builder(
+ GenericChainSpec::builder(
collectives_westend_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend-dev".into(), para_id: 1002 },
@@ -205,13 +203,13 @@ pub fn collectives_westend_development_config() -> CollectivesWestendChainSpec {
}
/// Collectives Westend Local Config.
-pub fn collectives_westend_local_config() -> CollectivesWestendChainSpec {
+pub fn collectives_westend_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
properties.insert("tokenSymbol".into(), "WND".into());
properties.insert("tokenDecimals".into(), 12.into());
- CollectivesWestendChainSpec::builder(
+ GenericChainSpec::builder(
collectives_westend_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend-local".into(), para_id: 1002 },
diff --git a/cumulus/polkadot-parachain/src/chain_spec/contracts.rs b/cumulus/polkadot-parachain/src/chain_spec/contracts.rs
index 7ca66354fbfde..87ac1ed2fa189 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/contracts.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/contracts.rs
@@ -15,7 +15,8 @@
// along with Cumulus. If not, see .
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
@@ -23,8 +24,6 @@ use parachains_common::{AccountId, AuraId};
use sc_service::ChainType;
use sp_core::{crypto::UncheckedInto, sr25519};
-pub type ContractsRococoChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
/// No relay chain suffix because the id is the same over all relay chains.
const CONTRACTS_PARACHAIN_ID: u32 = 1002;
@@ -32,12 +31,12 @@ const CONTRACTS_PARACHAIN_ID: u32 = 1002;
const CONTRACTS_ROCOCO_ED: contracts_rococo_runtime::Balance =
parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT;
-pub fn contracts_rococo_development_config() -> ContractsRococoChainSpec {
+pub fn contracts_rococo_development_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "ROC".into());
properties.insert("tokenDecimals".into(), 12.into());
- ContractsRococoChainSpec::builder(
+ GenericChainSpec::builder(
contracts_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
@@ -79,12 +78,12 @@ pub fn contracts_rococo_development_config() -> ContractsRococoChainSpec {
.build()
}
-pub fn contracts_rococo_local_config() -> ContractsRococoChainSpec {
+pub fn contracts_rococo_local_config() -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "ROC".into());
properties.insert("tokenDecimals".into(), 12.into());
- ContractsRococoChainSpec::builder(
+ GenericChainSpec::builder(
contracts_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
@@ -126,13 +125,13 @@ pub fn contracts_rococo_local_config() -> ContractsRococoChainSpec {
.build()
}
-pub fn contracts_rococo_config() -> ContractsRococoChainSpec {
+pub fn contracts_rococo_config() -> GenericChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "ROC".into());
properties.insert("tokenDecimals".into(), 12.into());
- ContractsRococoChainSpec::builder(
+ GenericChainSpec::builder(
contracts_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo".into(), para_id: CONTRACTS_PARACHAIN_ID }
)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/glutton.rs b/cumulus/polkadot-parachain/src/chain_spec/glutton.rs
index aff1358d1aecb..8eced8d8f816d 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/glutton.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/glutton.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use crate::chain_spec::{get_account_id_from_seed, Extensions};
+use crate::chain_spec::{get_account_id_from_seed, Extensions, GenericChainSpec};
use cumulus_primitives_core::ParaId;
use parachains_common::AuraId;
use sc_service::ChainType;
@@ -22,12 +22,8 @@ use sp_core::sr25519;
use super::get_collator_keys_from_seed;
-/// Specialized `ChainSpec` for the Glutton parachain runtime.
-pub type GluttonChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-pub type GluttonWestendChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
-pub fn glutton_development_config(para_id: ParaId) -> GluttonChainSpec {
- GluttonChainSpec::builder(
+pub fn glutton_development_config(para_id: ParaId) -> GenericChainSpec {
+ GenericChainSpec::builder(
glutton_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama-dev".into(), para_id: para_id.into() },
)
@@ -41,8 +37,8 @@ pub fn glutton_development_config(para_id: ParaId) -> GluttonChainSpec {
.build()
}
-pub fn glutton_local_config(para_id: ParaId) -> GluttonChainSpec {
- GluttonChainSpec::builder(
+pub fn glutton_local_config(para_id: ParaId) -> GenericChainSpec {
+ GenericChainSpec::builder(
glutton_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama-local".into(), para_id: para_id.into() },
)
@@ -59,11 +55,11 @@ pub fn glutton_local_config(para_id: ParaId) -> GluttonChainSpec {
.build()
}
-pub fn glutton_config(para_id: ParaId) -> GluttonChainSpec {
+pub fn glutton_config(para_id: ParaId) -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
- GluttonChainSpec::builder(
+ GenericChainSpec::builder(
glutton_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "kusama".into(), para_id: para_id.into() },
)
@@ -94,8 +90,8 @@ fn glutton_genesis(parachain_id: ParaId, collators: Vec) -> serde_json::
})
}
-pub fn glutton_westend_development_config(para_id: ParaId) -> GluttonWestendChainSpec {
- GluttonWestendChainSpec::builder(
+pub fn glutton_westend_development_config(para_id: ParaId) -> GenericChainSpec {
+ GenericChainSpec::builder(
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend-dev".into(), para_id: para_id.into() },
)
@@ -109,8 +105,8 @@ pub fn glutton_westend_development_config(para_id: ParaId) -> GluttonWestendChai
.build()
}
-pub fn glutton_westend_local_config(para_id: ParaId) -> GluttonWestendChainSpec {
- GluttonWestendChainSpec::builder(
+pub fn glutton_westend_local_config(para_id: ParaId) -> GenericChainSpec {
+ GenericChainSpec::builder(
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend-local".into(), para_id: para_id.into() },
)
@@ -127,11 +123,11 @@ pub fn glutton_westend_local_config(para_id: ParaId) -> GluttonWestendChainSpec
.build()
}
-pub fn glutton_westend_config(para_id: ParaId) -> GluttonWestendChainSpec {
+pub fn glutton_westend_config(para_id: ParaId) -> GenericChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 42.into());
- GluttonChainSpec::builder(
+ GenericChainSpec::builder(
glutton_westend_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend".into(), para_id: para_id.into() },
)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/mod.rs b/cumulus/polkadot-parachain/src/chain_spec/mod.rs
index 9cd0a37ad633b..e8ed8a74ed799 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/mod.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/mod.rs
@@ -50,6 +50,9 @@ impl Extensions {
}
}
+/// Generic chain spec for all polkadot-parachain runtimes
+pub type GenericChainSpec = sc_service::GenericChainSpec<(), Extensions>;
+
/// Helper function to generate a crypto pair from seed
pub fn get_from_seed(seed: &str) -> ::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs
index 2e35ee231dfff..cb1cb632d6384 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs
@@ -15,23 +15,22 @@
// along with Cumulus. If not, see .
use crate::chain_spec::{
- get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION,
+ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, GenericChainSpec,
+ SAFE_XCM_VERSION,
};
use cumulus_primitives_core::ParaId;
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<(), Extensions>;
-pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> PenpalChainSpec {
+pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> GenericChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "UNIT".into());
properties.insert("tokenDecimals".into(), 12u32.into());
properties.insert("ss58Format".into(), 42u32.into());
- PenpalChainSpec::builder(
+ GenericChainSpec::builder(
penpal_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: relay_chain.into(), // You MUST set this to the correct network!
diff --git a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs b/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs
index c2ba443145683..0434e5f7be8fb 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs
@@ -16,7 +16,7 @@
//! ChainSpecs dedicated to Rococo parachain setups (for testing and example purposes)
-use crate::chain_spec::{get_from_seed, Extensions, SAFE_XCM_VERSION};
+use crate::chain_spec::{get_from_seed, Extensions, GenericChainSpec, SAFE_XCM_VERSION};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use parachains_common::AccountId;
@@ -25,10 +25,8 @@ use rococo_parachain_runtime::AuraId;
use sc_chain_spec::ChainType;
use sp_core::{crypto::UncheckedInto, sr25519};
-pub type RococoParachainChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
-pub fn rococo_parachain_local_config() -> RococoParachainChainSpec {
- RococoParachainChainSpec::builder(
+pub fn rococo_parachain_local_config() -> GenericChainSpec {
+ GenericChainSpec::builder(
rococo_parachain_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo-local".into(), para_id: 1000 },
)
@@ -57,9 +55,9 @@ pub fn rococo_parachain_local_config() -> RococoParachainChainSpec {
.build()
}
-pub fn staging_rococo_parachain_local_config() -> RococoParachainChainSpec {
+pub fn staging_rococo_parachain_local_config() -> GenericChainSpec {
#[allow(deprecated)]
- RococoParachainChainSpec::builder(
+ GenericChainSpec::builder(
rococo_parachain_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "rococo-local".into(), para_id: 1000 },
)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/seedling.rs b/cumulus/polkadot-parachain/src/chain_spec/seedling.rs
index b034588e14c08..32d5162205457 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/seedling.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/seedling.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use crate::chain_spec::{get_account_id_from_seed, Extensions};
+use crate::chain_spec::{get_account_id_from_seed, Extensions, GenericChainSpec};
use cumulus_primitives_core::ParaId;
use parachains_common::{AccountId, AuraId};
use sc_service::ChainType;
@@ -22,11 +22,8 @@ use sp_core::sr25519;
use super::get_collator_keys_from_seed;
-/// Specialized `ChainSpec` for the seedling parachain runtime.
-pub type SeedlingChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
-pub fn get_seedling_chain_spec() -> SeedlingChainSpec {
- SeedlingChainSpec::builder(
+pub fn get_seedling_chain_spec() -> GenericChainSpec {
+ GenericChainSpec::builder(
seedling_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend".into(), para_id: 2000 },
)
diff --git a/cumulus/polkadot-parachain/src/chain_spec/shell.rs b/cumulus/polkadot-parachain/src/chain_spec/shell.rs
index 02c65e809a6c9..e0a9875fb96f2 100644
--- a/cumulus/polkadot-parachain/src/chain_spec/shell.rs
+++ b/cumulus/polkadot-parachain/src/chain_spec/shell.rs
@@ -14,18 +14,15 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use crate::chain_spec::Extensions;
+use crate::chain_spec::{Extensions, GenericChainSpec};
use cumulus_primitives_core::ParaId;
use parachains_common::AuraId;
use sc_service::ChainType;
use super::get_collator_keys_from_seed;
-/// Specialized `ChainSpec` for the shell parachain runtime.
-pub type ShellChainSpec = sc_service::GenericChainSpec<(), Extensions>;
-
-pub fn get_shell_chain_spec() -> ShellChainSpec {
- ShellChainSpec::builder(
+pub fn get_shell_chain_spec() -> GenericChainSpec {
+ GenericChainSpec::builder(
shell_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions { relay_chain: "westend".into(), para_id: 1000 },
)
diff --git a/cumulus/polkadot-parachain/src/command.rs b/cumulus/polkadot-parachain/src/command.rs
index ea19ad12ba05d..f966a5db8f312 100644
--- a/cumulus/polkadot-parachain/src/command.rs
+++ b/cumulus/polkadot-parachain/src/command.rs
@@ -16,6 +16,7 @@
use crate::{
chain_spec,
+ chain_spec::GenericChainSpec,
cli::{Cli, RelayChainCli, Subcommand},
fake_runtime_api::{
asset_hub_polkadot_aura::RuntimeApi as AssetHubPolkadotRuntimeApi, aura::RuntimeApi,
@@ -128,18 +129,15 @@ fn load_spec(id: &str) -> std::result::Result, String> {
// - Defaul-like
"staging" =>
Box::new(chain_spec::rococo_parachain::staging_rococo_parachain_local_config()),
- "tick" =>
- Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/tick.json")[..],
- )?),
- "trick" =>
- Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/trick.json")[..],
- )?),
- "track" =>
- Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/track.json")[..],
- )?),
+ "tick" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/tick.json")[..],
+ )?),
+ "trick" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/trick.json")[..],
+ )?),
+ "track" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/track.json")[..],
+ )?),
// -- Starters
"shell" => Box::new(chain_spec::shell::get_shell_chain_spec()),
@@ -154,10 +152,9 @@ fn load_spec(id: &str) -> std::result::Result, String> {
"asset-hub-polkadot-genesis" | "statemint-genesis" =>
Box::new(chain_spec::asset_hubs::asset_hub_polkadot_config()),
// the shell-based chain spec as used for syncing
- "asset-hub-polkadot" | "statemint" =>
- Box::new(chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/asset-hub-polkadot.json")[..],
- )?),
+ "asset-hub-polkadot" | "statemint" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/asset-hub-polkadot.json")[..],
+ )?),
// -- Asset Hub Kusama
"asset-hub-kusama-dev" | "statemine-dev" =>
@@ -168,10 +165,9 @@ fn load_spec(id: &str) -> std::result::Result, String> {
"asset-hub-kusama-genesis" | "statemine-genesis" =>
Box::new(chain_spec::asset_hubs::asset_hub_kusama_config()),
// the shell-based chain spec as used for syncing
- "asset-hub-kusama" | "statemine" =>
- Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/asset-hub-kusama.json")[..],
- )?),
+ "asset-hub-kusama" | "statemine" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/asset-hub-kusama.json")[..],
+ )?),
// -- Asset Hub Rococo
"asset-hub-rococo-dev" =>
@@ -181,10 +177,9 @@ fn load_spec(id: &str) -> std::result::Result, String> {
// the chain spec as used for generating the upgrade genesis values
"asset-hub-rococo-genesis" =>
Box::new(chain_spec::asset_hubs::asset_hub_rococo_genesis_config()),
- "asset-hub-rococo" =>
- Box::new(chain_spec::asset_hubs::AssetHubRococoChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/asset-hub-rococo.json")[..],
- )?),
+ "asset-hub-rococo" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/asset-hub-rococo.json")[..],
+ )?),
// -- Asset Hub Westend
"asset-hub-westend-dev" | "westmint-dev" =>
@@ -195,28 +190,25 @@ fn load_spec(id: &str) -> std::result::Result, String> {
"asset-hub-westend-genesis" | "westmint-genesis" =>
Box::new(chain_spec::asset_hubs::asset_hub_westend_config()),
// the shell-based chain spec as used for syncing
- "asset-hub-westend" | "westmint" =>
- Box::new(chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/asset-hub-westend.json")[..],
- )?),
+ "asset-hub-westend" | "westmint" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/asset-hub-westend.json")[..],
+ )?),
// -- Polkadot Collectives
"collectives-polkadot-dev" =>
Box::new(chain_spec::collectives::collectives_polkadot_development_config()),
"collectives-polkadot-local" =>
Box::new(chain_spec::collectives::collectives_polkadot_local_config()),
- "collectives-polkadot" =>
- Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/collectives-polkadot.json")[..],
- )?),
+ "collectives-polkadot" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/collectives-polkadot.json")[..],
+ )?),
"collectives-westend-dev" =>
Box::new(chain_spec::collectives::collectives_westend_development_config()),
"collectives-westend-local" =>
Box::new(chain_spec::collectives::collectives_westend_local_config()),
- "collectives-westend" =>
- Box::new(chain_spec::collectives::CollectivesWestendChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/collectives-westend.json")[..],
- )?),
+ "collectives-westend" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/collectives-westend.json")[..],
+ )?),
// -- Contracts on Rococo
"contracts-rococo-dev" =>
@@ -224,10 +216,9 @@ fn load_spec(id: &str) -> std::result::Result, String> {
"contracts-rococo-local" =>
Box::new(chain_spec::contracts::contracts_rococo_local_config()),
"contracts-rococo-genesis" => Box::new(chain_spec::contracts::contracts_rococo_config()),
- "contracts-rococo" =>
- Box::new(chain_spec::contracts::ContractsRococoChainSpec::from_json_bytes(
- &include_bytes!("../chain-specs/contracts-rococo.json")[..],
- )?),
+ "contracts-rococo" => Box::new(GenericChainSpec::from_json_bytes(
+ &include_bytes!("../chain-specs/contracts-rococo.json")[..],
+ )?),
// -- BridgeHub
bridge_like_id
@@ -279,44 +270,7 @@ fn load_spec(id: &str) -> std::result::Result, String> {
},
// -- Loading a specific spec from disk
- path => {
- let path: PathBuf = path.into();
- match path.runtime() {
- Runtime::AssetHubPolkadot => Box::new(
- chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_file(path)?,
- ),
- Runtime::AssetHubKusama =>
- Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_file(path)?),
- Runtime::AssetHubRococo =>
- Box::new(chain_spec::asset_hubs::AssetHubRococoChainSpec::from_json_file(path)?),
- Runtime::AssetHubWestend => Box::new(
- chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_file(path)?,
- ),
- Runtime::CollectivesPolkadot => Box::new(
- chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_file(path)?,
- ),
- Runtime::CollectivesWestend => Box::new(
- chain_spec::collectives::CollectivesWestendChainSpec::from_json_file(path)?,
- ),
- Runtime::Shell =>
- Box::new(chain_spec::shell::ShellChainSpec::from_json_file(path)?),
- Runtime::Seedling =>
- Box::new(chain_spec::seedling::SeedlingChainSpec::from_json_file(path)?),
- Runtime::ContractsRococo =>
- Box::new(chain_spec::contracts::ContractsRococoChainSpec::from_json_file(path)?),
- Runtime::BridgeHub(bridge_hub_runtime_type) =>
- bridge_hub_runtime_type.chain_spec_from_json_file(path)?,
- Runtime::Penpal(_para_id) =>
- Box::new(chain_spec::penpal::PenpalChainSpec::from_json_file(path)?),
- Runtime::GluttonWestend =>
- Box::new(chain_spec::glutton::GluttonChainSpec::from_json_file(path)?),
- Runtime::Glutton =>
- Box::new(chain_spec::glutton::GluttonChainSpec::from_json_file(path)?),
- Runtime::Default => Box::new(
- chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_file(path)?,
- ),
- }
- },
+ path => Box::new(GenericChainSpec::from_json_file(path.into())?),
})
}