From 89d09e78c1bf01e3feeead78bb12649548757b6b Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Dec 2024 16:35:38 +0100 Subject: [PATCH] create RELAY_CHAIN const --- templates/parachain/node/src/chain_spec.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/parachain/node/src/chain_spec.rs b/templates/parachain/node/src/chain_spec.rs index 43beff1642dc..52b8d56f9eb0 100644 --- a/templates/parachain/node/src/chain_spec.rs +++ b/templates/parachain/node/src/chain_spec.rs @@ -7,6 +7,8 @@ use serde::{Deserialize, Serialize}; /// Specialized `ChainSpec` for the normal parachain runtime. pub type ChainSpec = sc_service::GenericChainSpec; +/// Parachain id used for gensis config presets of parachain template. +pub const RELAY_CHAIN: &'static str = "rococo-local"; /// The extensions for the [`ChainSpec`]. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)] @@ -35,7 +37,7 @@ pub fn development_chain_spec() -> ChainSpec { ChainSpec::builder( runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - Extensions { relay_chain: "rococo-local".into(), para_id: runtime::PARACHAIN_ID }, + Extensions { relay_chain: RELAY_CHAIN.into(), para_id: runtime::PARACHAIN_ID }, ) .with_name("Development") .with_id("dev") @@ -55,7 +57,7 @@ pub fn local_chain_spec() -> ChainSpec { #[allow(deprecated)] ChainSpec::builder( runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - Extensions { relay_chain: "rococo-local".into(), para_id: runtime::PARACHAIN_ID }, + Extensions { relay_chain: RELAY_CHAIN.into(), para_id: runtime::PARACHAIN_ID }, ) .with_name("Local Testnet") .with_id("local_testnet")