referrerpolicy=no-referrer-when-downgrade

Trait sc_consensus_epochs::IsDescendentOfBuilder

source ·
pub trait IsDescendentOfBuilder<Hash> {
    type Error: Error;
    type IsDescendentOf: Fn(&Hash, &Hash) -> Result<bool, Self::Error>;

    // Required method
    fn build_is_descendent_of(
        &self,
        current: Option<(Hash, Hash)>,
    ) -> Self::IsDescendentOf;
}
Expand description

A builder for is_descendent_of functions.

Required Associated Types§

source

type Error: Error

The error returned by the function.

source

type IsDescendentOf: Fn(&Hash, &Hash) -> Result<bool, Self::Error>

A function that can tell you if the second parameter is a descendent of the first.

Required Methods§

source

fn build_is_descendent_of( &self, current: Option<(Hash, Hash)>, ) -> Self::IsDescendentOf

Build an is_descendent_of function.

The current parameter can be Some with the details a fresh block whose details aren’t yet stored, but its parent is.

The format of current when Some is (current, current_parent).

Implementors§

source§

impl<'a, H, Block> IsDescendentOfBuilder<<Block as Block>::Hash> for HeaderBackendDescendentBuilder<&'a H, Block>
where H: HeaderBackend<Block> + HeaderMetadata<Block, Error = Error>, Block: BlockT,

§

type Error = Error

§

type IsDescendentOf = Box<dyn Fn(&<Block as Block>::Hash, &<Block as Block>::Hash) -> Result<bool, Error> + 'a>