mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Adds --no-validator CLI flag (#3348)
* Implement `is_validator` for offchain-workers * Introduce `--no-validator` flag * Don't run babe/grandpa/im-online when `--no-validator` is given * Fixes compilation * Bump spec version * Improve error handling in executor * Add missing extern function * Revert making error public * Remove `--no-validator` CLI
This commit is contained in:
@@ -268,6 +268,7 @@ pub trait OffchainWorker<C: Components> {
|
||||
>,
|
||||
pool: &Arc<TransactionPool<C::TransactionPoolApi>>,
|
||||
network_state: &Arc<dyn NetworkStateInfo + Send + Sync>,
|
||||
is_validator: bool,
|
||||
) -> error::Result<Box<dyn Future<Item = (), Error = ()> + Send>>;
|
||||
}
|
||||
|
||||
@@ -284,8 +285,9 @@ impl<C: Components> OffchainWorker<Self> for C where
|
||||
>,
|
||||
pool: &Arc<TransactionPool<C::TransactionPoolApi>>,
|
||||
network_state: &Arc<dyn NetworkStateInfo + Send + Sync>,
|
||||
is_validator: bool,
|
||||
) -> error::Result<Box<dyn Future<Item = (), Error = ()> + Send>> {
|
||||
let future = offchain.on_block_imported(number, pool, network_state.clone())
|
||||
let future = offchain.on_block_imported(number, pool, network_state.clone(), is_validator)
|
||||
.map(|()| Ok(()));
|
||||
Ok(Box::new(Compat::new(future)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user