Trait polkadot_service::CallExecutor
source · pub trait CallExecutor<B>: RuntimeVersionOfwhere
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, Global>, Error>;
fn contextual_call<EM, R, NC>(
&self,
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>>>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<Recorder<<<B as Block>::Header as Header>::Hashing>>,
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>,
R: Encode + Decode + PartialEq<R>,
NC: FnOnce() -> Result<R, ApiError> + UnwindSafe,
ExecutionManager<EM>: Clone;
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, Global>, StorageProof), Error>;
}
Expand description
Method call executor.
Required Associated Types§
Required Methods§
sourcefn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8, Global>, Error>
fn call(
&self,
id: &BlockId<B>,
method: &str,
call_data: &[u8],
strategy: ExecutionStrategy,
extensions: Option<Extensions>
) -> Result<Vec<u8, Global>, Error>
Execute a call to a contract on top of state in a block of given hash.
No changes are made.
sourcefn contextual_call<EM, R, NC>(
&self,
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>>>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<Recorder<<<B as Block>::Header as Header>::Hashing>>,
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>,
R: Encode + Decode + PartialEq<R>,
NC: FnOnce() -> Result<R, ApiError> + UnwindSafe,
ExecutionManager<EM>: Clone,
fn contextual_call<EM, R, NC>(
&self,
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>>>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
proof_recorder: &Option<Recorder<<<B as Block>::Header as Header>::Hashing>>,
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>,
R: Encode + Decode + PartialEq<R>,
NC: FnOnce() -> Result<R, ApiError> + UnwindSafe,
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.
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.