Struct substrate_test_client::TestClientBuilder [−][src]
pub struct TestClientBuilder<Block: BlockT, Executor, Backend, G: GenesisInit> { /* fields omitted */ }
Expand description
A builder for creating a test client instance.
Implementations
impl<Block: BlockT, Executor, G: GenesisInit> TestClientBuilder<Block, Executor, Backend<Block>, G>
impl<Block: BlockT, Executor, G: GenesisInit> TestClientBuilder<Block, Executor, Backend<Block>, G>
Create new TestClientBuilder
with default backend.
Create new TestClientBuilder
with default backend and pruning window size
Create new TestClientBuilder
with default backend and storage chain mode
impl<Block: BlockT, Executor, Backend, G: GenesisInit> TestClientBuilder<Block, Executor, Backend, G>
impl<Block: BlockT, Executor, Backend, G: GenesisInit> TestClientBuilder<Block, Executor, Backend, G>
Create a new instance of the test client builder.
Set the keystore that should be used by the externalities.
Alter the genesis storage parameters.
Extend child storage
Set the execution strategy that should be used by all contexts.
pub fn set_block_rules(
self,
fork_blocks: ForkBlocks<Block>,
bad_blocks: BadBlocks<Block>
) -> Self
pub fn set_block_rules(
self,
fork_blocks: ForkBlocks<Block>,
bad_blocks: BadBlocks<Block>
) -> Self
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
Executor: CallExecutor<Block> + 'static,
Backend: Backend<Block>,
<Backend as Backend<Block>>::OffchainStorage: 'static,
pub fn build_with_executor<RuntimeApi>(
self,
executor: Executor
) -> (Client<Backend, Executor, Block, RuntimeApi>, LongestChain<Backend, Block>) where
Executor: CallExecutor<Block> + 'static,
Backend: Backend<Block>,
<Backend as Backend<Block>>::OffchainStorage: 'static,
Build the test client with the given native executor.
impl<Block: BlockT, E, Backend, G: GenesisInit> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Backend, G>
impl<Block: BlockT, E, Backend, G: GenesisInit> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Backend, G>
pub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I
) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Block, RuntimeApi>, LongestChain<Backend, Block>) where
I: Into<Option<NativeExecutor<E>>>,
E: NativeExecutionDispatch + 'static,
Backend: Backend<Block> + 'static,
pub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I
) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeExecutor<E>>, Block, RuntimeApi>, LongestChain<Backend, Block>) where
I: Into<Option<NativeExecutor<E>>>,
E: NativeExecutionDispatch + 'static,
Backend: Backend<Block> + 'static,
Build the test client with the given native executor.
Trait Implementations
impl<Block: BlockT, Executor, G: GenesisInit> Default for TestClientBuilder<Block, Executor, Backend<Block>, G>
impl<Block: BlockT, Executor, G: GenesisInit> Default for TestClientBuilder<Block, Executor, Backend<Block>, G>
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 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