mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 13:48:00 +00:00
Fix substrate factory CLI command (#3239)
* CLI execution flag for import-blocks and factory. * Fix minimum_balance bug with CLI factory.
This commit is contained in:
committed by
Bastian Köcher
parent
c9c0ad4756
commit
8aa367c27a
@@ -51,7 +51,7 @@ use params::{
|
||||
NetworkConfigurationParams, MergeParameters, TransactionPoolParams,
|
||||
NodeKeyParams, NodeKeyType, Cors,
|
||||
};
|
||||
pub use params::{NoCustom, CoreParams, SharedParams};
|
||||
pub use params::{NoCustom, CoreParams, SharedParams, ExecutionStrategy as ExecutionStrategyParam};
|
||||
pub use traits::{GetLogFilter, AugmentClap};
|
||||
use app_dirs::{AppInfo, AppDataType};
|
||||
use log::info;
|
||||
@@ -639,7 +639,12 @@ where
|
||||
E: IntoExit,
|
||||
S: FnOnce(&str) -> Result<Option<ChainSpec<FactoryGenesis<F>>>, String>,
|
||||
{
|
||||
let config = create_config_with_db_path::<F, _>(spec_factory, &cli.shared_params, version)?;
|
||||
let mut config = create_config_with_db_path::<F, _>(spec_factory, &cli.shared_params, version)?;
|
||||
config.execution_strategies = ExecutionStrategies {
|
||||
importing: cli.execution.into(),
|
||||
other: cli.execution.into(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let file: Box<dyn Read> = match cli.input {
|
||||
Some(filename) => Box::new(File::open(filename)?),
|
||||
|
||||
@@ -33,6 +33,7 @@ macro_rules! impl_get_log_filter {
|
||||
|
||||
arg_enum! {
|
||||
/// How to execute blocks
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum ExecutionStrategy {
|
||||
Native,
|
||||
@@ -610,6 +611,18 @@ pub struct ImportBlocksCmd {
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
pub shared_params: SharedParams,
|
||||
|
||||
/// The means of execution used when calling into the runtime while importing blocks.
|
||||
#[structopt(
|
||||
long = "execution",
|
||||
value_name = "STRATEGY",
|
||||
raw(
|
||||
possible_values = "&ExecutionStrategy::variants()",
|
||||
case_insensitive = "true",
|
||||
default_value = r#""NativeElseWasm""#
|
||||
)
|
||||
)]
|
||||
pub execution: ExecutionStrategy,
|
||||
}
|
||||
|
||||
impl_get_log_filter!(ImportBlocksCmd);
|
||||
|
||||
Reference in New Issue
Block a user