Allow custom polkadot chainspec. (#122)

This commit is contained in:
Joshy Orndorff
2020-06-18 03:54:47 -04:00
committed by GitHub
parent 456c562cff
commit 071d7a11c4
+9 -5
View File
@@ -102,11 +102,15 @@ impl SubstrateCli for PolkadotCli {
"cumulus-test-parachain-collator" "cumulus-test-parachain-collator"
} }
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> { fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
polkadot_service::PolkadotChainSpec::from_json_bytes( Ok(match id {
&include_bytes!("../res/polkadot_chainspec.json")[..], "" | "local" | "dev" => Box::new(polkadot_service::PolkadotChainSpec::from_json_bytes(
) &include_bytes!("../res/polkadot_chainspec.json")[..],
.map(|r| Box::new(r) as Box<_>) )?),
path => Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
)?),
})
} }
} }