Struct substrate_test_client::client::LocalCallExecutor [−][src]
pub struct LocalCallExecutor<Block, B, E> where
Block: Block, { /* fields omitted */ }
Expand description
Call executor that executes methods locally, querying all required data from local backend.
Implementations
impl<Block, B, E> LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
impl<Block, B, E> LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
pub fn new(
backend: Arc<B>,
executor: E,
spawn_handle: Box<dyn SpawnNamed + 'static, Global>,
client_config: ClientConfig<Block>
) -> Result<LocalCallExecutor<Block, B, E>, Error>
pub fn new(
backend: Arc<B>,
executor: E,
spawn_handle: Box<dyn SpawnNamed + 'static, Global>,
client_config: ClientConfig<Block>
) -> Result<LocalCallExecutor<Block, B, E>, Error>
Creates new instance of local call executor.
Trait Implementations
impl<B, E, Block> CallExecutor<Block> for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
impl<B, E, Block> CallExecutor<Block> for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
type Error = <E as CodeExecutor>::Error
type Error = <E as CodeExecutor>::Error
Externalities error type.
type Backend = B
type Backend = B
The backend used by the node.
Execute a call to a contract on top of state in a block of given hash. Read more
pub fn contextual_call<EM, R, NC>(
&self,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<<<B as Backend<Block>>::State as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction, <<Block as Block>::Header as Header>::Hashing, <<Block as Block>::Header as Header>::Number>>>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<<Block as Block>::Hash>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
R: Encode + Decode + PartialEq<R>,
EM: Fn(Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>, Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>) -> Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>,
NC: FnOnce() -> Result<R, ApiError> + UnwindSafe,
ExecutionManager<EM>: Clone,
pub fn contextual_call<EM, R, NC>(
&self,
at: &BlockId<Block>,
method: &str,
call_data: &[u8],
changes: &RefCell<OverlayedChanges>,
storage_transaction_cache: Option<&RefCell<StorageTransactionCache<<<B as Backend<Block>>::State as Backend<<<Block as Block>::Header as Header>::Hashing>>::Transaction, <<Block as Block>::Header as Header>::Hashing, <<Block as Block>::Header as Header>::Number>>>,
execution_manager: ExecutionManager<EM>,
native_call: Option<NC>,
recorder: &Option<ProofRecorder<<Block as Block>::Hash>>,
extensions: Option<Extensions>
) -> Result<NativeOrEncoded<R>, Error> where
R: Encode + Decode + PartialEq<R>,
EM: Fn(Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>, Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>) -> Result<NativeOrEncoded<R>, <LocalCallExecutor<Block, B, E> as CallExecutor<Block>>::Error>,
NC: FnOnce() -> Result<R, ApiError> + UnwindSafe,
ExecutionManager<EM>: Clone,
Execute a contextual call on top of state in a block of a given hash. Read more
Extract RuntimeVersion of given block Read more
impl<Block, B, E> GetNativeVersion for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + GetNativeVersion + Clone + 'static,
B: Backend<Block>,
impl<Block, B, E> GetNativeVersion for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + GetNativeVersion + Clone + 'static,
B: Backend<Block>,
Returns the version of the native runtime.
impl<Block, B, E> GetRuntimeVersionAt<Block> for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
impl<Block, B, E> GetRuntimeVersionAt<Block> for LocalCallExecutor<Block, B, E> where
Block: Block,
E: CodeExecutor + RuntimeVersionOf + Clone + 'static,
B: Backend<Block>,
Returns the version of runtime at the given block.
Auto Trait Implementations
impl<Block, B, E> !RefUnwindSafe for LocalCallExecutor<Block, B, E>
impl<Block, B, E> Send for LocalCallExecutor<Block, B, E> where
B: Send + Sync,
E: Send,
impl<Block, B, E> Sync for LocalCallExecutor<Block, B, E> where
B: Send + Sync,
E: Sync,
impl<Block, B, E> Unpin for LocalCallExecutor<Block, B, E> where
E: Unpin,
<Block as Block>::Hash: Unpin,
impl<Block, B, E> !UnwindSafe for LocalCallExecutor<Block, B, E>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more