Can now disable the keystore (#3004)

* Can now disable the keystore

* Fix service test

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix cli
This commit is contained in:
Pierre Krieger
2019-07-04 10:33:43 +02:00
committed by Bastian Köcher
parent 4fe9e8732f
commit eca9c36b75
5 changed files with 51 additions and 42 deletions
+4 -8
View File
@@ -399,13 +399,9 @@ where
let base_path = base_path(&cli.shared_params, version);
config.keystore_path = cli.keystore_path
.unwrap_or_else(|| keystore_path(&base_path, config.chain_spec.id()))
.to_string_lossy()
.into();
config.keystore_path = cli.keystore_path.or_else(|| Some(keystore_path(&base_path, config.chain_spec.id())));
config.database_path =
db_path(&base_path, config.chain_spec.id()).to_string_lossy().into();
config.database_path = db_path(&base_path, config.chain_spec.id());
config.database_cache_size = cli.database_cache_size;
config.state_cache_size = cli.state_cache_size;
config.pruning = match cli.pruning {
@@ -594,7 +590,7 @@ where
let base_path = base_path(cli, version);
let mut config = service::Configuration::default_with_spec(spec.clone());
config.database_path = db_path(&base_path, spec.id()).to_string_lossy().into();
config.database_path = db_path(&base_path, spec.id());
Ok(config)
}
@@ -612,7 +608,7 @@ where
{
let config = create_config_with_db_path::<F, _>(spec_factory, &cli.shared_params, version)?;
info!("DB path: {}", config.database_path);
info!("DB path: {}", config.database_path.display());
let from = cli.from.unwrap_or(1);
let to = cli.to;
let json = cli.json;