Trait sc_client_api::call_executor::CallExecutor
source · pub trait CallExecutor<B: BlockT>: RuntimeVersionOf {
type Error: Error;
type Backend: Backend<B>;
// Required methods
fn execution_extensions(&self) -> &ExecutionExtensions<B>;
fn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy
) -> Result<Vec<u8>, Error>;
fn contextual_call(
&self,
at: &BlockId<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>,
proof_recorder: &Option<ProofRecorder<B>>,
context: ExecutionContext
) -> Result<Vec<u8>>;
fn runtime_version(&self, id: &BlockId<B>) -> Result<RuntimeVersion, Error>;
fn prove_execution(
&self,
at: &BlockId<B>,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>;
}
Expand description
Method call executor.
Required Associated Types§
Required Methods§
sourcefn execution_extensions(&self) -> &ExecutionExtensions<B>
fn execution_extensions(&self) -> &ExecutionExtensions<B>
Returns the ExecutionExtensions
.
sourcefn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy
) -> Result<Vec<u8>, Error>
fn call( &self, id: &BlockId<B>, method: &str, call_data: &[u8], strategy: ExecutionStrategy ) -> Result<Vec<u8>, Error>
Execute a call to a contract on top of state in a block of given hash.
No changes are made.
sourcefn contextual_call(
&self,
at: &BlockId<B>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>,
proof_recorder: &Option<ProofRecorder<B>>,
context: ExecutionContext
) -> Result<Vec<u8>>
fn contextual_call( &self, at: &BlockId<B>, method: &str, call_data: &[u8], changes: &RefCell<OverlayedChanges>, storage_transaction_cache: Option<&RefCell<StorageTransactionCache<B, <Self::Backend as Backend<B>>::State>>>, proof_recorder: &Option<ProofRecorder<B>>, context: ExecutionContext ) -> Result<Vec<u8>>
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.
sourcefn 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.
sourcefn prove_execution(
&self,
at: &BlockId<B>,
method: &str,
call_data: &[u8]
) -> Result<(Vec<u8>, StorageProof), Error>
fn prove_execution( &self, at: &BlockId<B>, method: &str, call_data: &[u8] ) -> Result<(Vec<u8>, StorageProof), Error>
Prove the execution of the given method
.
No changes are made.