pub struct LongestChain<B, Block> { /* private fields */ }
Expand description
Implement Longest Chain Select implementation where ‘longest’ is defined as the highest number of blocks
Implementations§
Trait Implementations§
source§impl<B, Block> Clone for LongestChain<B, Block>
impl<B, Block> Clone for LongestChain<B, Block>
source§impl<B, Block> SelectChain<Block> for LongestChain<B, Block>
impl<B, Block> SelectChain<Block> for LongestChain<B, Block>
source§fn leaves<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Block as BlockT>::Hash>, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn leaves<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Block as BlockT>::Hash>, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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 BlockT>::Header, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn best_chain<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<Block as BlockT>::Header, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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::Hash,
maybe_max_number: Option<NumberFor<Block>>,
) -> Pin<Box<dyn Future<Output = Result<Block::Hash, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn finality_target<'life0, 'async_trait>(
&'life0 self,
base_hash: Block::Hash,
maybe_max_number: Option<NumberFor<Block>>,
) -> Pin<Box<dyn Future<Output = Result<Block::Hash, ConsensusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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.Auto Trait Implementations§
impl<B, Block> Freeze for LongestChain<B, Block>
impl<B, Block> RefUnwindSafe for LongestChain<B, Block>where
Block: RefUnwindSafe,
B: RefUnwindSafe,
impl<B, Block> Send for LongestChain<B, Block>
impl<B, Block> Sync for LongestChain<B, Block>
impl<B, Block> Unpin for LongestChain<B, Block>where
Block: Unpin,
impl<B, Block> UnwindSafe for LongestChain<B, Block>where
B: RefUnwindSafe,
Block: UnwindSafe,
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§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 S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.