Trait finality_grandpa::Chain[][src]

pub trait Chain<H: Eq, N: Copy + BlockNumberOps> {
    fn ancestry(&self, base: H, block: H) -> Result<Vec<H>, Error>;
fn best_chain_containing(&self, base: H) -> Option<(H, N)>; fn is_equal_or_descendent_of(&self, base: H, block: H) -> bool { ... } }

Chain context necessary for implementation of the finality gadget.

Required methods

fn ancestry(&self, base: H, block: H) -> Result<Vec<H>, Error>[src]

Get the ancestry of a block up to but not including the base hash. Should be in reverse order from block’s parent.

If the block is not a descendent of base, returns an error.

fn best_chain_containing(&self, base: H) -> Option<(H, N)>[src]

Return the hash of the best block whose chain contains the given block hash, even if that block is base itself.

If base is unknown, return None.

Loading content...

Provided methods

fn is_equal_or_descendent_of(&self, base: H, block: H) -> bool[src]

Returns true if block is a descendent of or equal to the given base.

Loading content...

Implementors

Loading content...