Struct substrate_test_client::TestClientBuilder
source · pub struct TestClientBuilder<Block: BlockT, ExecutorDispatch, Backend: 'static, G: GenesisInit> { /* private fields */ }
Expand description
A builder for creating a test client instance.
Implementations§
source§impl<Block: BlockT, ExecutorDispatch, G: GenesisInit> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
impl<Block: BlockT, ExecutorDispatch, G: GenesisInit> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
sourcepub fn with_default_backend() -> Self
pub fn with_default_backend() -> Self
Create new TestClientBuilder
with default backend.
sourcepub fn with_pruning_window(blocks_pruning: u32) -> Self
pub fn with_pruning_window(blocks_pruning: u32) -> Self
Create new TestClientBuilder
with default backend and pruning window size
sourcepub fn with_tx_storage(blocks_pruning: u32) -> Self
pub fn with_tx_storage(blocks_pruning: u32) -> Self
Create new TestClientBuilder
with default backend and storage chain mode
source§impl<Block: BlockT, ExecutorDispatch, Backend, G: GenesisInit> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
impl<Block: BlockT, ExecutorDispatch, Backend, G: GenesisInit> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
sourcepub fn with_backend(backend: Arc<Backend>) -> Self
pub fn with_backend(backend: Arc<Backend>) -> Self
Create a new instance of the test client builder.
sourcepub fn genesis_init_mut(&mut self) -> &mut G
pub fn genesis_init_mut(&mut self) -> &mut G
Alter the genesis storage parameters.
sourcepub fn add_child_storage(
self,
child_info: &ChildInfo,
key: impl AsRef<[u8]>,
value: impl AsRef<[u8]>
) -> Self
pub fn add_child_storage( self, child_info: &ChildInfo, key: impl AsRef<[u8]>, value: impl AsRef<[u8]> ) -> Self
Extend child storage
sourcepub 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.
sourcepub fn enable_offchain_indexing_api(self) -> Self
pub fn enable_offchain_indexing_api(self) -> Self
Enable the offchain indexing api.
sourcepub fn set_no_genesis(self) -> Self
pub fn set_no_genesis(self) -> Self
Disable writing genesis.
sourcepub fn build_with_executor<RuntimeApi>(
self,
executor: ExecutorDispatch
) -> (Client<Backend, ExecutorDispatch, Block, RuntimeApi>, LongestChain<Backend, Block>)where
ExecutorDispatch: CallExecutor<Block> + RuntimeVersionOf + Clone + 'static,
Backend: Backend<Block>,
<Backend as Backend<Block>>::OffchainStorage: 'static,
pub fn build_with_executor<RuntimeApi>( self, executor: ExecutorDispatch ) -> (Client<Backend, ExecutorDispatch, Block, RuntimeApi>, LongestChain<Backend, Block>)where ExecutorDispatch: CallExecutor<Block> + RuntimeVersionOf + Clone + 'static, Backend: Backend<Block>, <Backend as Backend<Block>>::OffchainStorage: 'static,
Build the test client with the given native executor.
source§impl<Block: BlockT, D, Backend, G: GenesisInit> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeElseWasmExecutor<D>>, Backend, G>where
D: NativeExecutionDispatch,
impl<Block: BlockT, D, Backend, G: GenesisInit> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, NativeElseWasmExecutor<D>>, Backend, G>where D: NativeExecutionDispatch,
sourcepub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I
) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeElseWasmExecutor<D>>, Block, RuntimeApi>, LongestChain<Backend, Block>)where
I: Into<Option<NativeElseWasmExecutor<D>>>,
D: NativeExecutionDispatch + 'static,
Backend: Backend<Block> + 'static,
pub fn build_with_native_executor<RuntimeApi, I>( self, executor: I ) -> (Client<Backend, LocalCallExecutor<Block, Backend, NativeElseWasmExecutor<D>>, Block, RuntimeApi>, LongestChain<Backend, Block>)where I: Into<Option<NativeElseWasmExecutor<D>>>, D: NativeExecutionDispatch + 'static, Backend: Backend<Block> + 'static,
Build the test client with the given native executor.
Trait Implementations§
Auto Trait Implementations§
impl<Block, ExecutorDispatch, Backend, G> RefUnwindSafe for TestClientBuilder<Block, ExecutorDispatch, Backend, G>where Backend: RefUnwindSafe, ExecutorDispatch: RefUnwindSafe, G: RefUnwindSafe, <Block as Block>::Hash: RefUnwindSafe, <<Block as Block>::Header as Header>::Number: RefUnwindSafe,
impl<Block, ExecutorDispatch, Backend, G> Send for TestClientBuilder<Block, ExecutorDispatch, Backend, G>where Backend: Send + Sync, ExecutorDispatch: Send, G: Send,
impl<Block, ExecutorDispatch, Backend, G> Sync for TestClientBuilder<Block, ExecutorDispatch, Backend, G>where Backend: Send + Sync, ExecutorDispatch: Sync, G: Sync,
impl<Block, ExecutorDispatch, Backend, G> Unpin for TestClientBuilder<Block, ExecutorDispatch, Backend, G>where ExecutorDispatch: Unpin, G: Unpin, <Block as Block>::Hash: Unpin, <<Block as Block>::Header as Header>::Number: Unpin,
impl<Block, ExecutorDispatch, Backend, G> UnwindSafe for TestClientBuilder<Block, ExecutorDispatch, Backend, G>where Backend: RefUnwindSafe, ExecutorDispatch: UnwindSafe, G: UnwindSafe, <Block as Block>::Hash: UnwindSafe, <<Block as Block>::Header as Header>::Number: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.