Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit a0c2f3a

Browse files
add penpal rococo runtime
1 parent eba035e commit a0c2f3a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cumulus/polkadot-parachain/src/command.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
245245
.load_config()?,
246246

247247
// -- Penpall
248+
"penpal-rococo" => Box::new(chain_spec::penpal::get_penpal_chain_spec(
249+
para_id.expect("Must specify parachain id"),
250+
"rococo-local",
251+
)),
248252
"penpal-kusama" => Box::new(chain_spec::penpal::get_penpal_chain_spec(
249253
para_id.expect("Must specify parachain id"),
250254
"kusama-local",
@@ -315,14 +319,18 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
315319
/// (H/T to Phala for the idea)
316320
/// E.g. "penpal-kusama-2004" yields ("penpal-kusama", Some(2004))
317321
fn extract_parachain_id(id: &str) -> (&str, &str, Option<ParaId>) {
322+
const ROCOCO_TEST_PARA_PREFIX: &str = "penpal-rococo-";
318323
const KUSAMA_TEST_PARA_PREFIX: &str = "penpal-kusama-";
319324
const POLKADOT_TEST_PARA_PREFIX: &str = "penpal-polkadot-";
320325

321326
const GLUTTON_PARA_DEV_PREFIX: &str = "glutton-kusama-dev-";
322327
const GLUTTON_PARA_LOCAL_PREFIX: &str = "glutton-kusama-local-";
323328
const GLUTTON_PARA_GENESIS_PREFIX: &str = "glutton-kusama-genesis-";
324329

325-
let (norm_id, orig_id, para) = if let Some(suffix) = id.strip_prefix(KUSAMA_TEST_PARA_PREFIX) {
330+
let (norm_id, orig_id, para) = if let Some(suffix) = id.strip_prefix(ROCOCO_TEST_PARA_PREFIX) {
331+
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
332+
(&id[..ROCOCO_TEST_PARA_PREFIX.len() - 1], id, Some(para_id))
333+
} else if let Some(suffix) = id.strip_prefix(KUSAMA_TEST_PARA_PREFIX) {
326334
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
327335
(&id[..KUSAMA_TEST_PARA_PREFIX.len() - 1], id, Some(para_id))
328336
} else if let Some(suffix) = id.strip_prefix(POLKADOT_TEST_PARA_PREFIX) {

0 commit comments

Comments
 (0)