referrerpolicy=no-referrer-when-downgrade
cumulus_test_client

Type Alias LongestChain

Source
pub type LongestChain = LongestChain<Backend, Block>;
Expand description

LongestChain type for the test runtime/client.

Aliased Type§

struct LongestChain { /* private fields */ }

Implementations

Source§

impl<B, Block> LongestChain<B, Block>
where B: Backend<Block>, Block: Block,

Source

pub fn new(backend: Arc<B>) -> LongestChain<B, Block>

Instantiate a new LongestChain for Backend B

Trait Implementations

Source§

impl<B, Block> Clone for LongestChain<B, Block>

Source§

fn clone(&self) -> LongestChain<B, Block>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B, Block> SelectChain<Block> for LongestChain<B, Block>
where B: Backend<Block>, Block: Block,

Source§

fn leaves<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<<Block as Block>::Hash>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, LongestChain<B, Block>: 'async_trait,

Get all leaves of the chain, i.e. block hashes that have no children currently. Leaves that can never be finalized will not be returned.
Source§

fn best_chain<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<Block as Block>::Header, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, LongestChain<B, Block>: 'async_trait,

Among those leaves deterministically pick one chain as the generally best chain to author new blocks upon and probably (but not necessarily) finalize.
Source§

fn finality_target<'life0, 'async_trait>( &'life0 self, base_hash: <Block as Block>::Hash, maybe_max_number: Option<<<Block as Block>::Header as Header>::Number>, ) -> Pin<Box<dyn Future<Output = Result<<Block as Block>::Hash, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, LongestChain<B, Block>: 'async_trait,

Get the best descendent of base_hash that we should attempt to finalize next, if any. It is valid to return the given base_hash itself if no better descendent exists.