Skip to content
Snippets Groups Projects
Commit a9100449 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

RPC calls should execute with configured strategy (#4772)

parent 4c361433
No related merge requests found
......@@ -30,7 +30,7 @@ use sp_blockchain::{
Result as ClientResult, Error as ClientError, HeaderMetadata, CachedHeaderMetadata
};
use sc_client::{
Client, CallExecutor, BlockchainEvents,
Client, CallExecutor, BlockchainEvents
};
use sp_core::{
Bytes, storage::{well_known_keys, StorageKey, StorageData, StorageChangeSet, ChildInfo},
......@@ -213,15 +213,14 @@ impl<B, E, Block: BlockT, RA> FullState<B, E, Block, RA>
}
}
impl<B, E, Block, RA> StateBackend<B, E, Block, RA> for FullState<B, E, Block, RA>
where
Block: BlockT + 'static,
B: Backend<Block> + Send + Sync + 'static,
E: CallExecutor<Block> + Send + Sync + 'static + Clone,
RA: Send + Sync + 'static,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api:
Metadata<Block, Error = sp_blockchain::Error>,
impl<B, E, Block, RA> StateBackend<B, E, Block, RA> for FullState<B, E, Block, RA> where
Block: BlockT + 'static,
B: Backend<Block> + Send + Sync + 'static,
E: CallExecutor<Block> + Send + Sync + 'static + Clone,
RA: Send + Sync + 'static,
Client<B, E, Block, RA>: ProvideRuntimeApi<Block>,
<Client<B, E, Block, RA> as ProvideRuntimeApi<Block>>::Api:
Metadata<Block, Error = sp_blockchain::Error>,
{
fn call(
&self,
......@@ -229,21 +228,20 @@ impl<B, E, Block, RA> StateBackend<B, E, Block, RA> for FullState<B, E, Block, R
method: String,
call_data: Bytes,
) -> FutureResult<Bytes> {
Box::new(result(
self.block_or_best(block)
.and_then(|block|
self
.client
.executor()
.call(
&BlockId::Hash(block),
&method,
&*call_data,
ExecutionStrategy::NativeElseWasm,
None,
)
.map(Into::into))
.map_err(client_err)))
let r = self.block_or_best(block)
.and_then(|block| self
.client
.executor()
.call(
&BlockId::Hash(block),
&method,
&*call_data,
self.client.execution_extensions().strategies().other,
None,
)
.map(Into::into)
).map_err(client_err);
Box::new(result(r))
}
fn storage_keys(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment