Skip to content
Snippets Groups Projects
Commit d1e78cc6 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

add embeded client spec and genesis in binary

(this re-buids chainspecs at each run)
parent d1c607e0
No related branches found
No related tags found
1 merge request!171prepare gtest runtime
......@@ -150,18 +150,26 @@ impl SubstrateCli for Cli {
.map_err(|e| format!("failed to read {JSON_GENESIS} {e}"))?[..],
)
.map_err(|e| format!("failed to parse {e}"))?;
// rebuild chainspecs from these files
Box::new(chain_spec::gtest::live_chainspecs(
client_spec,
genesis_data,
)?)
}
// hardcoded previously generated raw chainspecs
// return hardcoded live chainspecs
// embed client spec and genesis to avoid embeding hexadecimal runtime
// and having hexadecimal runtime in git history
#[cfg(feature = "gtest")]
"gtest" => {
unimplemented!();
// Box::new(chain_spec::gtest::ChainSpec::from_json_bytes(
// &include_bytes!("../specs/gtest-raw.json")[..],
// )?)
let client_spec: gtest::ClientSpec =
serde_json::from_slice(include_bytes!("../specs/gtest_client-specs.json"))
.unwrap();
let genesis_data: gtest_genesis::GenesisJson =
serde_json::from_slice(include_bytes!("../specs/gtest_genesis.json")).unwrap();
Box::new(chain_spec::gtest::live_chainspecs(
client_spec,
genesis_data,
)?)
}
// === G1 ===
#[cfg(feature = "g1")]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment