pub type TestClientBuilder = TestClientBuilder<Block, Executor, Backend, GenesisParameters>;
Expand description
Test client builder for Cumulus
Aliased Type§
struct TestClientBuilder { /* private fields */ }
Implementations
Source§impl<Block, ExecutorDispatch, G> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>where
Block: Block,
G: GenesisInit,
impl<Block, ExecutorDispatch, G> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>where
Block: Block,
G: GenesisInit,
Sourcepub fn with_default_backend() -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
pub fn with_default_backend() -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
Create new TestClientBuilder
with default backend.
Sourcepub fn with_pruning_window(
blocks_pruning: u32,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
pub fn with_pruning_window( blocks_pruning: u32, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
Create new TestClientBuilder
with default backend and pruning window size
Sourcepub fn with_tx_storage(
blocks_pruning: u32,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
pub fn with_tx_storage( blocks_pruning: u32, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
Create new TestClientBuilder
with default backend and storage chain mode
Source§impl<Block, ExecutorDispatch, Backend, G> TestClientBuilder<Block, ExecutorDispatch, Backend, G>where
Block: Block,
G: GenesisInit,
impl<Block, ExecutorDispatch, Backend, G> TestClientBuilder<Block, ExecutorDispatch, Backend, G>where
Block: Block,
G: GenesisInit,
Sourcepub fn with_backend(
backend: Arc<Backend>,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn with_backend( backend: Arc<Backend>, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
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]>,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn add_child_storage( self, child_info: &ChildInfo, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
Extend child storage
Sourcepub fn set_block_rules(
self,
fork_blocks: Option<Vec<(<<Block as Block>::Header as Header>::Number, <Block as Block>::Hash)>>,
bad_blocks: Option<HashSet<<Block as Block>::Hash>>,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn set_block_rules( self, fork_blocks: Option<Vec<(<<Block as Block>::Header as Header>::Number, <Block as Block>::Hash)>>, bad_blocks: Option<HashSet<<Block as Block>::Hash>>, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
Sets custom block rules.
Sourcepub fn enable_offchain_indexing_api(
self,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn enable_offchain_indexing_api( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
Enable the offchain indexing api.
Sourcepub fn enable_import_proof_recording(
self,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn enable_import_proof_recording( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
Enable proof recording on import.
Sourcepub fn set_no_genesis(
self,
) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
pub fn set_no_genesis( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>
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, H, Backend, G> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, WasmExecutor<H>>, Backend, G>where
Block: Block,
G: GenesisInit,
impl<Block, H, Backend, G> TestClientBuilder<Block, LocalCallExecutor<Block, Backend, WasmExecutor<H>>, Backend, G>where
Block: Block,
G: GenesisInit,
Sourcepub fn build_with_native_executor<RuntimeApi, I>(
self,
executor: I,
) -> (Client<Backend, LocalCallExecutor<Block, Backend, WasmExecutor<H>>, Block, RuntimeApi>, LongestChain<Backend, Block>)
pub fn build_with_native_executor<RuntimeApi, I>( self, executor: I, ) -> (Client<Backend, LocalCallExecutor<Block, Backend, WasmExecutor<H>>, Block, RuntimeApi>, LongestChain<Backend, Block>)
Build the test client with the given native executor.
Trait Implementations§
Source§impl TestClientBuilderExt for TestClientBuilder
impl TestClientBuilderExt for TestClientBuilder
Source§fn build_with_longest_chain(self) -> (Client, LongestChain)
fn build_with_longest_chain(self) -> (Client, LongestChain)
Build the test client and longest chain selector.