referrerpolicy=no-referrer-when-downgrade
cumulus_test_client

Type Alias TestClientBuilder

Source
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,

Source

pub fn with_default_backend() -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>

Create new TestClientBuilder with default backend.

Source

pub fn with_pruning_window( blocks_pruning: u32, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>

Create new TestClientBuilder with default backend and pruning window size

Source

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,

Source

pub fn with_backend( backend: Arc<Backend>, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>

Create a new instance of the test client builder.

Source

pub fn genesis_init_mut(&mut self) -> &mut G

Alter the genesis storage parameters.

Source

pub fn backend(&self) -> Arc<Backend>

Give access to the underlying backend of these clients

Source

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

Source

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.

Source

pub fn enable_offchain_indexing_api( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>

Enable the offchain indexing api.

Source

pub fn enable_import_proof_recording( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>

Enable proof recording on import.

Source

pub fn set_no_genesis( self, ) -> TestClientBuilder<Block, ExecutorDispatch, Backend, G>

Disable writing genesis.

Source

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,

Source

pub fn build_with_native_executor<RuntimeApi, I>( self, executor: I, ) -> (Client<Backend, LocalCallExecutor<Block, Backend, WasmExecutor<H>>, Block, RuntimeApi>, LongestChain<Backend, Block>)
where I: Into<Option<WasmExecutor<H>>>, Backend: Backend<Block> + 'static, H: HostFunctions,

Build the test client with the given native executor.

Trait Implementations§

Source§

impl DefaultTestClientBuilderExt for TestClientBuilder

Source§

fn new() -> Self

Create new TestClientBuilder
Source§

impl TestClientBuilderExt for TestClientBuilder

Source§

fn build_with_longest_chain(self) -> (Client, LongestChain)

Build the test client and longest chain selector.
Source§

fn build(self) -> Client

Build the test client.
Source§

impl<Block, ExecutorDispatch, G> Default for TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>
where Block: Block, G: GenesisInit,

Source§

fn default() -> TestClientBuilder<Block, ExecutorDispatch, Backend<Block>, G>

Returns the “default value” for a type. Read more