type FullSelectChain = LongestChain<TFullBackend<Block>, Block>;

Aliased Type§

struct FullSelectChain {
    backend: Arc<Backend<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>>,
    _phantom: PhantomData<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>,
}

Fields§

§backend: Arc<Backend<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>>§_phantom: PhantomData<Block<Header<u32, BlakeTwo256>, OpaqueExtrinsic>>

Implementations

§

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

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

Instantiate a new LongestChain for Backend B

Trait Implementations

§

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

§

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
§

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

§

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.
§

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.
§

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.