diff --git a/node/src/command.rs b/node/src/command.rs index bd16a8f0fe2759936a3afb38872fe0f2f18efa2d..4d4047c2015b96106bba0ab2602a9e5343dc7f13 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -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")]