mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
Allow custom polkadot chainspec. (#122)
This commit is contained in:
@@ -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 {
|
||||||
|
"" | "local" | "dev" => Box::new(polkadot_service::PolkadotChainSpec::from_json_bytes(
|
||||||
&include_bytes!("../res/polkadot_chainspec.json")[..],
|
&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),
|
||||||
|
)?),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user