Skip to content
Snippets Groups Projects
Commit 51fed219 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

fix(#125): review: gtest does not compile

parent 0730417a
No related branches found
No related tags found
No related merge requests found
Pipeline #33552 failed
......@@ -40,7 +40,6 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
.public()
}
/// Generate an account ID from seed.
pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId
where
......
......@@ -146,7 +146,7 @@ pub struct ClientSpec {
/// generate development chainspec with Alice validator
// there is some code duplication because we can not use ClientSpec
pub fn development_chainspecs(json_file_path: &str) -> Result<ChainSpec, String> {
pub fn development_chainspecs(json_file_path: String) -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
......@@ -159,7 +159,7 @@ pub fn development_chainspecs(json_file_path: &str) -> Result<ChainSpec, String>
move || {
let genesis_data =
gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>(
json_file_path.to_owned(),
json_file_path.clone(),
get_parameters,
Some("Alice".to_owned()),
)
......@@ -193,7 +193,10 @@ pub fn development_chainspecs(json_file_path: &str) -> Result<ChainSpec, String>
/// live chainspecs
// one smith must have session keys
pub fn live_chainspecs(client_spec: ClientSpec, json_file_path: &str) -> Result<ChainSpec, String> {
pub fn live_chainspecs(
client_spec: ClientSpec,
json_file_path: String,
) -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
......@@ -206,7 +209,7 @@ pub fn live_chainspecs(client_spec: ClientSpec, json_file_path: &str) -> Result<
move || {
let genesis_data =
gen_genesis_data::generate_genesis_data::<_, _, SessionKeys, GTestSKP>(
json_file_path.to_owned(),
json_file_path.clone(),
get_parameters,
None,
)
......@@ -244,6 +247,7 @@ fn genesis_data_to_gtest_genesis_conf(
initial_monetary_mass,
memberships,
parameters,
common_parameters,
session_keys_map,
smith_certs_by_receiver,
smith_memberships,
......
......@@ -137,7 +137,7 @@ impl SubstrateCli for Cli {
// otherwise you get a local testnet with generated genesis
#[cfg(feature = "gtest")]
"gtest_dev" => Box::new(chain_spec::gtest::development_chainspecs(
"resources/gtest.json",
"resources/gtest.json".to_string(),
)?),
// chainspecs for live network
// must have following files in ./node/specs folder or overwrite with env var:
......@@ -157,7 +157,7 @@ impl SubstrateCli for Cli {
// rebuild chainspecs from these files
Box::new(chain_spec::gtest::live_chainspecs(
client_spec,
"resources/gtest.json",
"resources/gtest.json".to_string(),
)?)
}
// return hardcoded live chainspecs, only with embed feature
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment