Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
add penpal rococo runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Nov 21, 2023
1 parent eba035e commit a0c2f3a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cumulus/polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
.load_config()?,

// -- Penpall
"penpal-rococo" => Box::new(chain_spec::penpal::get_penpal_chain_spec(
para_id.expect("Must specify parachain id"),
"rococo-local",
)),
"penpal-kusama" => Box::new(chain_spec::penpal::get_penpal_chain_spec(
para_id.expect("Must specify parachain id"),
"kusama-local",
Expand Down Expand Up @@ -315,14 +319,18 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
/// (H/T to Phala for the idea)
/// E.g. "penpal-kusama-2004" yields ("penpal-kusama", Some(2004))
fn extract_parachain_id(id: &str) -> (&str, &str, Option<ParaId>) {
const ROCOCO_TEST_PARA_PREFIX: &str = "penpal-rococo-";
const KUSAMA_TEST_PARA_PREFIX: &str = "penpal-kusama-";
const POLKADOT_TEST_PARA_PREFIX: &str = "penpal-polkadot-";

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

let (norm_id, orig_id, para) = if let Some(suffix) = id.strip_prefix(KUSAMA_TEST_PARA_PREFIX) {
let (norm_id, orig_id, para) = if let Some(suffix) = id.strip_prefix(ROCOCO_TEST_PARA_PREFIX) {
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
(&id[..ROCOCO_TEST_PARA_PREFIX.len() - 1], id, Some(para_id))
} else if let Some(suffix) = id.strip_prefix(KUSAMA_TEST_PARA_PREFIX) {
let para_id: u32 = suffix.parse().expect("Invalid parachain-id suffix");
(&id[..KUSAMA_TEST_PARA_PREFIX.len() - 1], id, Some(para_id))
} else if let Some(suffix) = id.strip_prefix(POLKADOT_TEST_PARA_PREFIX) {
Expand Down

0 comments on commit a0c2f3a

Please sign in to comment.