Shared params in CLI API (#4466)

* Common shared parames getter

* Expose more types from `service-builder`

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2019-12-20 16:05:01 +01:00
committed by Bastian Köcher
parent bfad5f3ffc
commit 9950ea98fc
6 changed files with 47 additions and 69 deletions
+6 -4
View File
@@ -21,7 +21,7 @@ use sc_cli::{IntoExit, NoCustom, SharedParams, ImportParams, error};
use sc_service::{AbstractService, Roles as ServiceRoles, Configuration};
use log::info;
use structopt::{StructOpt, clap::App};
use sc_cli::{display_role, parse_and_prepare, AugmentClap, GetLogFilter, ParseAndPrepare};
use sc_cli::{display_role, parse_and_prepare, AugmentClap, GetSharedParams, ParseAndPrepare};
use crate::{service, ChainSpec, load_spec};
use crate::factory_impl::FactoryState;
use node_transaction_factory::RuntimeAdapter;
@@ -38,9 +38,11 @@ pub enum CustomSubcommands {
Factory(FactoryCmd),
}
impl GetLogFilter for CustomSubcommands {
fn get_log_filter(&self) -> Option<String> {
None
impl GetSharedParams for CustomSubcommands {
fn shared_params(&self) -> Option<&SharedParams> {
match self {
CustomSubcommands::Factory(cmd) => Some(&cmd.shared_params),
}
}
}