Trait sc_consensus_epochs::IsDescendentOfBuilder[][src]

pub trait IsDescendentOfBuilder<Hash> {
    type Error: Error;
    type IsDescendentOf: Fn(&Hash, &Hash) -> Result<bool, Self::Error>;
    fn build_is_descendent_of(
        &self,
        current: Option<(Hash, Hash)>
    ) -> Self::IsDescendentOf; }

A builder for is_descendent_of functions.

Associated Types

type Error: Error[src]

The error returned by the function.

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

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

Loading content...

Required methods

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

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

Loading content...

Implementors

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

type Error = ClientError

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

Loading content...