mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 05:17:58 +00:00
improve ocw validator/collator CLI description (#12931)
* improve ocw validator/collator CLI description * rename WhenValidating to WhenAuthoring * Update client/cli/src/arg_enums.rs Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
This commit is contained in:
@@ -232,8 +232,9 @@ pub enum OffchainWorkerEnabled {
|
||||
Always,
|
||||
/// Never enable the offchain worker.
|
||||
Never,
|
||||
/// Only enable the offchain worker when running as validator.
|
||||
WhenValidating,
|
||||
/// Only enable the offchain worker when running as a validator (or collator, if this is a
|
||||
/// parachain node).
|
||||
WhenAuthority,
|
||||
}
|
||||
|
||||
/// Syncing mode.
|
||||
|
||||
@@ -40,7 +40,7 @@ pub struct OffchainWorkerParams {
|
||||
value_name = "ENABLED",
|
||||
value_enum,
|
||||
ignore_case = true,
|
||||
default_value_t = OffchainWorkerEnabled::WhenValidating
|
||||
default_value_t = OffchainWorkerEnabled::WhenAuthority
|
||||
)]
|
||||
pub enabled: OffchainWorkerEnabled,
|
||||
|
||||
@@ -56,10 +56,10 @@ impl OffchainWorkerParams {
|
||||
/// Load spec to `Configuration` from `OffchainWorkerParams` and spec factory.
|
||||
pub fn offchain_worker(&self, role: &Role) -> error::Result<OffchainWorkerConfig> {
|
||||
let enabled = match (&self.enabled, role) {
|
||||
(OffchainWorkerEnabled::WhenValidating, Role::Authority { .. }) => true,
|
||||
(OffchainWorkerEnabled::WhenAuthority, Role::Authority { .. }) => true,
|
||||
(OffchainWorkerEnabled::Always, _) => true,
|
||||
(OffchainWorkerEnabled::Never, _) => false,
|
||||
(OffchainWorkerEnabled::WhenValidating, _) => false,
|
||||
(OffchainWorkerEnabled::WhenAuthority, _) => false,
|
||||
};
|
||||
|
||||
let indexing_enabled = self.indexing_enabled;
|
||||
|
||||
Reference in New Issue
Block a user