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