mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Introduce capabilities filtering for off-chain runtime calls. (#3454)
* Introduce capabilities filtering for calls. * Bump impl version. * Allow RichOffchainCall to only read offchain db. * Fix code. * Panic on invalid calls. * Merge execution contexts and expose capabilities. * Fix repr * Re-enable keystore for offchain calls.
This commit is contained in:
committed by
Bastian Köcher
parent
d81df14391
commit
0128d0db84
@@ -43,7 +43,7 @@ use client::runtime_api::ApiExt;
|
||||
use futures::future::Future;
|
||||
use log::{debug, warn};
|
||||
use network::NetworkStateInfo;
|
||||
use primitives::ExecutionContext;
|
||||
use primitives::{offchain, ExecutionContext};
|
||||
use sr_primitives::{generic::BlockId, traits::{self, ProvideRuntimeApi}};
|
||||
use transaction_pool::txpool::{Pool, ChainApi};
|
||||
|
||||
@@ -122,7 +122,7 @@ impl<Client, Storage, Block> OffchainWorkers<
|
||||
debug!("Running offchain workers at {:?}", at);
|
||||
let run = runtime.offchain_worker_with_context(
|
||||
&at,
|
||||
ExecutionContext::OffchainWorker(api),
|
||||
ExecutionContext::OffchainCall(Some((api, offchain::Capabilities::all()))),
|
||||
number,
|
||||
);
|
||||
if let Err(e) = run {
|
||||
|
||||
Reference in New Issue
Block a user