Trait sc_client_api::call_executor::CallExecutor
source · [−]pub trait CallExecutor<B: BlockT> {
type Error: Error;
type Backend: Backend<B>;
fn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8>, Error>;
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<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<ProofRecorder<B>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>>
where
ExecutionManager<EM>: Clone;
fn runtime_version(&self, id: &BlockId<B>) -> Result<RuntimeVersion, Error>;
fn prove_at_trie_state<S: TrieBackendStorage<HashFor<B>>>(
&self,
trie_state: &TrieBackend<S, HashFor<B>>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>;
fn native_runtime_version(&self) -> Option<&NativeVersion>;
fn prove_at_state<S: Backend<HashFor<B>>>(
&self,
state: S,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error> { ... }
}
Expand description
Method call executor.
Associated Types
Required methods
Execute a call to a contract on top of state in a block of given hash.
No changes are made.
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<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<ProofRecorder<B>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>> where
ExecutionManager<EM>: Clone,
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<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>,
initialize_block: InitializeBlock<'a, B>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<ProofRecorder<B>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>> where
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>
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: TrieBackendStorage<HashFor<B>>>(
&self,
trie_state: &TrieBackend<S, HashFor<B>>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>
fn prove_at_trie_state<S: TrieBackendStorage<HashFor<B>>>(
&self,
trie_state: &TrieBackend<S, HashFor<B>>,
overlay: &mut OverlayedChanges,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>
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>
fn native_runtime_version(&self) -> Option<&NativeVersion>
Get runtime version if supported.