mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
Offchain-worker: Make it possible to disable http support (#10087)
* Offchain-worker: Make it possible to disable http support If a chain doesn't require http support in its offchain workers, this pr enables them to disable the http support. * Switch to bitflags * Use Capabilities * Update client/offchain/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Fix test * Update client/offchain/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
@@ -118,15 +118,13 @@ impl ExecutionContext {
|
||||
use ExecutionContext::*;
|
||||
|
||||
match self {
|
||||
Importing | Syncing | BlockConstruction => offchain::Capabilities::none(),
|
||||
Importing | Syncing | BlockConstruction => offchain::Capabilities::empty(),
|
||||
// Enable keystore, transaction pool and Offchain DB reads by default for offchain
|
||||
// calls.
|
||||
OffchainCall(None) => [
|
||||
offchain::Capability::Keystore,
|
||||
offchain::Capability::OffchainDbRead,
|
||||
offchain::Capability::TransactionPool,
|
||||
][..]
|
||||
.into(),
|
||||
OffchainCall(None) =>
|
||||
offchain::Capabilities::KEYSTORE |
|
||||
offchain::Capabilities::OFFCHAIN_DB_READ |
|
||||
offchain::Capabilities::TRANSACTION_POOL,
|
||||
OffchainCall(Some((_, capabilities))) => *capabilities,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user