Struct substrate_test_runtime_client::TestClientBuilder [−][src]
pub struct TestClientBuilder<Block, Executor, Backend, G> where
Block: Block,
G: GenesisInit, { /* fields omitted */ }
Expand description
A builder for creating a test client instance.
Implementations
impl<Block, Executor, G> TestClientBuilder<Block, Executor, Backend<Block>, G> where
Block: Block,
G: GenesisInit,
impl<Block, Executor, G> TestClientBuilder<Block, Executor, Backend<Block>, G> where
Block: Block,
G: GenesisInit,
Create new TestClientBuilder
with default backend.
pub fn with_pruning_window(
keep_blocks: u32
) -> TestClientBuilder<Block, Executor, Backend<Block>, G>
pub fn with_pruning_window(
keep_blocks: u32
) -> TestClientBuilder<Block, Executor, Backend<Block>, G>
Create new TestClientBuilder
with default backend and pruning window size
pub fn with_tx_storage(
keep_blocks: u32
) -> TestClientBuilder<Block, Executor, Backend<Block>, G>
pub fn with_tx_storage(
keep_blocks: u32
) -> TestClientBuilder<Block, Executor, Backend<Block>, G>
Create new TestClientBuilder
with default backend and storage chain mode
impl<Block, Executor, Backend, G> TestClientBuilder<Block, Executor, Backend, G> where
Block: Block,
G: GenesisInit,
impl<Block, Executor, Backend, G> TestClientBuilder<Block, Executor, Backend, G> where
Block: Block,
G: GenesisInit,
Create a new instance of the test client builder.
pub fn set_keystore(
self,
keystore: Arc<dyn SyncCryptoStore + 'static>
) -> TestClientBuilder<Block, Executor, Backend, G>
pub fn set_keystore(
self,
keystore: Arc<dyn SyncCryptoStore + 'static>
) -> TestClientBuilder<Block, Executor, Backend, G>
Set the keystore that should be used by the externalities.
Alter the genesis storage parameters.
Extend child storage
pub fn set_execution_strategy(
self,
execution_strategy: ExecutionStrategy
) -> TestClientBuilder<Block, Executor, Backend, G>
pub fn set_execution_strategy(
self,
execution_strategy: ExecutionStrategy
) -> TestClientBuilder<Block, Executor, Backend, G>
Set the execution strategy that should be used by all contexts.
Sets custom block rules.
Enable the offchain indexing api.
Disable writing genesis.
pub fn build_with_executor<RuntimeApi>(
self,
executor: Executor
) -> (Client<Backend, Executor, Block, RuntimeApi>, LongestChain<Backend, Block>) where
Backend: Backend<Block>,
Executor: CallExecutor<Block> + 'static,
<Backend as Backend<Block>>::OffchainStorage: 'static,
pub fn build_with_executor<RuntimeApi>(
self,
executor: Executor
) -> (Client<Backend, Executor, Block, RuntimeApi>, LongestChain<Backend, Block>) where
Backend: Backend<Block>,
Executor: CallExecutor<Block> + 'static,
<Backend as Backend<Block>>::OffchainStorage: 'static,
Build the test client with the given native executor.
impl<Block, E, Backend, G> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Backend, G> where
Block: Block,
G: GenesisInit,
impl<Block, E, Backend, G> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Backend, G> where
Block: Block,
G: GenesisInit,
pub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I
) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Block, RuntimeApi>, LongestChain<Backend, Block>) where
Backend: Backend<Block> + 'static,
E: NativeExecutionDispatch + 'static,
I: Into<Option<NativeExecutor<E>>>,
pub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I
) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Block, RuntimeApi>, LongestChain<Backend, Block>) where
Backend: Backend<Block> + 'static,
E: NativeExecutionDispatch + 'static,
I: Into<Option<NativeExecutor<E>>>,
Build the test client with the given native executor.
Trait Implementations
impl<Block, Executor, G> Default for TestClientBuilder<Block, Executor, Backend<Block>, G> where
Block: Block,
G: GenesisInit,
impl<Block, Executor, G> Default for TestClientBuilder<Block, Executor, Backend<Block>, G> where
Block: Block,
G: GenesisInit,
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<Block, Executor, Backend, G> !RefUnwindSafe for TestClientBuilder<Block, Executor, Backend, G>
impl<Block, Executor, Backend, G> Send for TestClientBuilder<Block, Executor, Backend, G> where
Backend: Send + Sync,
Executor: Send,
G: Send,
impl<Block, Executor, Backend, G> Sync for TestClientBuilder<Block, Executor, Backend, G> where
Backend: Send + Sync,
Executor: Sync,
G: Sync,
impl<Block, Executor, Backend, G> Unpin for TestClientBuilder<Block, Executor, Backend, G> where
Executor: Unpin,
G: Unpin,
<Block as Block>::Hash: Unpin,
<<Block as Block>::Header as Header>::Number: Unpin,
impl<Block, Executor, Backend, G> !UnwindSafe for TestClientBuilder<Block, Executor, Backend, G>
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 inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
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