[][src]Trait sc_client::CallExecutor

pub trait CallExecutor<B> where
    B: Block
{ 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<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
;
fn runtime_version(&self, id: &BlockId<B>) -> Result<RuntimeVersion, Error>;
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>
;
fn native_runtime_version(&self) -> Option<&NativeVersion>; 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>
, { ... } }

Method call executor.

Associated Types

type Error: Error

Externalities error type.

type Backend: Backend<B>

The backend used by the node.

Loading content...

Required methods

fn call(
    &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

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>, 

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.

Loading content...

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>, 

Execute a call to a contract on top of given state, gathering execution proof.

No changes are made.

Loading content...

Implementors

impl<B, E, Block> CallExecutor<Block> for LocalCallExecutor<B, E> where
    B: Backend<Block>,
    E: CodeExecutor + RuntimeInfo + Clone + 'static,
    Block: BlockT
[src]

type Error = E::Error

type Backend = B

impl<Block, B, Local> CallExecutor<Block> for GenesisCallExecutor<B, Local> where
    Block: BlockT,
    B: RemoteBackend<Block>,
    Local: CallExecutor<Block>, 
[src]

type Error = ClientError

type Backend = B

Loading content...