Use ArgAction::Set for enable-offchain-indexing flag (#12521)

* Use ArgAction::Set for enable-offchain-indexing

* Provide default value for `enable-offchain-indexing`
This commit is contained in:
Sebastian Kunert
2022-10-18 17:41:19 +02:00
committed by GitHub
parent b16135f602
commit 096553cb59
@@ -23,7 +23,7 @@
//! targeted at handling input parameter parsing providing //! targeted at handling input parameter parsing providing
//! a reasonable abstraction. //! a reasonable abstraction.
use clap::Args; use clap::{ArgAction, Args};
use sc_network::config::Role; use sc_network::config::Role;
use sc_service::config::OffchainWorkerConfig; use sc_service::config::OffchainWorkerConfig;
@@ -48,7 +48,7 @@ pub struct OffchainWorkerParams {
/// ///
/// Enables a runtime to write directly to a offchain workers /// Enables a runtime to write directly to a offchain workers
/// DB during block import. /// DB during block import.
#[arg(long = "enable-offchain-indexing", value_name = "ENABLE_OFFCHAIN_INDEXING")] #[arg(long = "enable-offchain-indexing", value_name = "ENABLE_OFFCHAIN_INDEXING", default_value_t = false, action = ArgAction::Set)]
pub indexing_enabled: bool, pub indexing_enabled: bool,
} }