mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Off-chain indexing is independent from workers (#8659)
* Pff-chain indexing is independent from worker.
* Remove unauthorized changes.
* 🤦
This commit is contained in:
@@ -23,14 +23,13 @@
|
||||
//! targeted at handling input parameter parsing providing
|
||||
//! a reasonable abstraction.
|
||||
|
||||
use structopt::StructOpt;
|
||||
use sc_service::config::OffchainWorkerConfig;
|
||||
use sc_network::config::Role;
|
||||
use sc_service::config::OffchainWorkerConfig;
|
||||
use structopt::StructOpt;
|
||||
|
||||
use crate::error;
|
||||
use crate::OffchainWorkerEnabled;
|
||||
|
||||
|
||||
/// Offchain worker related parameters.
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct OffchainWorkerParams {
|
||||
@@ -59,11 +58,7 @@ pub struct OffchainWorkerParams {
|
||||
|
||||
impl OffchainWorkerParams {
|
||||
/// Load spec to `Configuration` from `OffchainWorkerParams` and spec factory.
|
||||
pub fn offchain_worker(
|
||||
&self,
|
||||
role: &Role,
|
||||
) -> error::Result<OffchainWorkerConfig>
|
||||
{
|
||||
pub fn offchain_worker(&self, role: &Role) -> error::Result<OffchainWorkerConfig> {
|
||||
let enabled = match (&self.enabled, role) {
|
||||
(OffchainWorkerEnabled::WhenValidating, Role::Authority { .. }) => true,
|
||||
(OffchainWorkerEnabled::Always, _) => true,
|
||||
@@ -71,8 +66,10 @@ impl OffchainWorkerParams {
|
||||
(OffchainWorkerEnabled::WhenValidating, _) => false,
|
||||
};
|
||||
|
||||
let indexing_enabled = enabled && self.indexing_enabled;
|
||||
|
||||
Ok(OffchainWorkerConfig { enabled, indexing_enabled })
|
||||
let indexing_enabled = self.indexing_enabled;
|
||||
Ok(OffchainWorkerConfig {
|
||||
enabled,
|
||||
indexing_enabled,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user