[−][src]Trait sc_client::CallExecutor
Method call executor.
Associated Types
Loading content...Required methods
fn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8>, Error>
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8>, Error>
Execute a call to a contract on top of state in a block of given hash.
No changes are made.
fn contextual_call<IB, EM, R, NC>(
&self,
initialize_block_fn: IB,
at: &BlockId<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<<<Self::Backend as Backend<B>>::State as Backend<<<B as Block>::Header as Header>::Hashing>>::Transaction, <<B as Block>::Header as Header>::Hashing, <<B as Block>::Header as Header>::Number>>>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<Arc<RwLock<RawRwLock, HashMap<<<<B as Block>::Header as Header>::Hashing as Hasher>::Out, Option<Vec<u8>>, RandomState>>>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
EM: Fn(Result<NativeOrEncoded<R>, Self::Error>, Result<NativeOrEncoded<R>, Self::Error>) -> Result<NativeOrEncoded<R>, Self::Error>,
IB: Fn() -> Result<(), Error>,
NC: UnwindSafe + FnOnce() -> Result<R, String>,
R: PartialEq<R> + Encode + Decode,
ExecutionManager<EM>: Clone,
&self,
initialize_block_fn: IB,
at: &BlockId<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<<<Self::Backend as Backend<B>>::State as Backend<<<B as Block>::Header as Header>::Hashing>>::Transaction, <<B as Block>::Header as Header>::Hashing, <<B as Block>::Header as Header>::Number>>>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<Arc<RwLock<RawRwLock, HashMap<<<<B as Block>::Header as Header>::Hashing as Hasher>::Out, Option<Vec<u8>>, RandomState>>>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
EM: Fn(Result<NativeOrEncoded<R>, Self::Error>, Result<NativeOrEncoded<R>, Self::Error>) -> Result<NativeOrEncoded<R>, Self::Error>,
IB: Fn() -> Result<(), Error>,
NC: UnwindSafe + FnOnce() -> Result<R, String>,
R: PartialEq<R> + Encode + Decode,
ExecutionManager<EM>: Clone,
Execute a contextual call on top of state in a block of a given hash.
No changes are made. Before executing the method, passed header is installed as the current header of the execution context.
fn runtime_version(&self, id: &BlockId<B>) -> Result<RuntimeVersion, Error>
Extract RuntimeVersion of given block
No changes are made.
fn prove_at_trie_state<S>(
&self,
trie_state: &TrieBackend<S, <<B as Block>::Header as Header>::Hashing>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error> where
S: TrieBackendStorage<<<B as Block>::Header as Header>::Hashing>,
&self,
trie_state: &TrieBackend<S, <<B as Block>::Header as Header>::Hashing>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error> where
S: TrieBackendStorage<<<B as Block>::Header as Header>::Hashing>,
Execute a call to a contract on top of given trie state, gathering execution proof.
No changes are made.
fn native_runtime_version(&self) -> Option<&NativeVersion>
Get runtime version if supported.
Provided methods
fn prove_at_state<S>(
&self,
state: S,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error> where
S: Backend<<<B as Block>::Header as Header>::Hashing>,
&self,
state: S,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error> where
S: Backend<<<B as Block>::Header as Header>::Hashing>,
Execute a call to a contract on top of given state, gathering execution proof.
No changes are made.
Implementors
impl<B, E, Block> CallExecutor<Block> for LocalCallExecutor<B, E> where
B: Backend<Block>,
E: CodeExecutor + RuntimeInfo + Clone + 'static,
Block: BlockT,
[src]
B: Backend<Block>,
E: CodeExecutor + RuntimeInfo + Clone + 'static,
Block: BlockT,
type Error = E::Error
type Backend = B
fn call(
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8>>
[src]
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8>>
fn contextual_call<'a, IB: Fn() -> Result<()>, EM: Fn(Result<NativeOrEncoded<R>, Self::Error>, Result<NativeOrEncoded<R>, Self::Error>) -> Result<NativeOrEncoded<R>, Self::Error>, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe>(
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<Block, B::State>>>,
initialize_block: InitializeBlock<'a, Block>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<Block>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
ExecutionManager<EM>: Clone,
[src]
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<Block, B::State>>>,
initialize_block: InitializeBlock<'a, Block>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<Block>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
ExecutionManager<EM>: Clone,
fn runtime_version(&self, id: &BlockId<Block>) -> Result<RuntimeVersion>
[src]
fn prove_at_trie_state<S: TrieBackendStorage<HashFor<Block>>>(
&self,
trie_state: &TrieBackend<S, HashFor<Block>>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>
[src]
&self,
trie_state: &TrieBackend<S, HashFor<Block>>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>
fn native_runtime_version(&self) -> Option<&NativeVersion>
[src]
impl<Block, B, Local> CallExecutor<Block> for GenesisCallExecutor<B, Local> where
Block: BlockT,
B: RemoteBackend<Block>,
Local: CallExecutor<Block>,
[src]
Block: BlockT,
B: RemoteBackend<Block>,
Local: CallExecutor<Block>,
type Error = ClientError
type Backend = B
fn call(
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> ClientResult<Vec<u8>>
[src]
&self,
id: &BlockId<Block>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> ClientResult<Vec<u8>>
fn contextual_call<'a, IB: Fn() -> ClientResult<()>, EM: Fn(Result<NativeOrEncoded<R>, Self::Error>, Result<NativeOrEncoded<R>, Self::Error>) -> Result<NativeOrEncoded<R>, Self::Error>, R: Encode + Decode + PartialEq, NC: FnOnce() -> Result<R, String> + UnwindSafe>(
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
_: Option<&RefCell<StorageTransactionCache<Block, B::State>>>,
initialize_block: InitializeBlock<'a, Block>,
_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<Block>>,
extensions: Option<Extensions>
) -> ClientResult<NativeOrEncoded<R>> where
ExecutionManager<EM>: Clone,
[src]
&self,
initialize_block_fn: IB,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
_: Option<&RefCell<StorageTransactionCache<Block, B::State>>>,
initialize_block: InitializeBlock<'a, Block>,
_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<Block>>,
extensions: Option<Extensions>
) -> ClientResult<NativeOrEncoded<R>> where
ExecutionManager<EM>: Clone,
fn runtime_version(&self, id: &BlockId<Block>) -> ClientResult<RuntimeVersion>
[src]
fn prove_at_trie_state<S: TrieBackendStorage<HashFor<Block>>>(
&self,
_state: &TrieBackend<S, HashFor<Block>>,
_changes: &mut OverlayedChanges,
_method: &str,
_call_data: &[u8]
) -> ClientResult<(Vec<u8>, StorageProof)>
[src]
&self,
_state: &TrieBackend<S, HashFor<Block>>,
_changes: &mut OverlayedChanges,
_method: &str,
_call_data: &[u8]
) -> ClientResult<(Vec<u8>, StorageProof)>