Skip to content

Commit b082e7f

Browse files
authored
Allow custom polkadot chainspec. (paritytech#122)
1 parent 8b1fd65 commit b082e7f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

test/parachain/src/command.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,15 @@ impl SubstrateCli for PolkadotCli {
102102
"cumulus-test-parachain-collator"
103103
}
104104

105-
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
106-
polkadot_service::PolkadotChainSpec::from_json_bytes(
107-
&include_bytes!("../res/polkadot_chainspec.json")[..],
108-
)
109-
.map(|r| Box::new(r) as Box<_>)
105+
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
106+
Ok(match id {
107+
"" | "local" | "dev" => Box::new(polkadot_service::PolkadotChainSpec::from_json_bytes(
108+
&include_bytes!("../res/polkadot_chainspec.json")[..],
109+
)?),
110+
path => Box::new(chain_spec::ChainSpec::from_json_file(
111+
std::path::PathBuf::from(path),
112+
)?),
113+
})
110114
}
111115
}
112116

0 commit comments

Comments
 (0)