Trait finality_grandpa::Chain
source · pub trait Chain<H, N: Copy + BlockNumberOps> {
fn ancestry(&self, base: H, block: H) -> Result<Vec<H>, Error>;
fn best_chain_containing(&self, base: H) -> Option<(H, N)>;
}
Expand description
Chain context necessary for implementation of the finality gadget.
Required Methods
sourcefn ancestry(&self, base: H, block: H) -> Result<Vec<H>, Error>
fn ancestry(&self, base: H, block: H) -> Result<Vec<H>, Error>
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.
sourcefn best_chain_containing(&self, base: H) -> Option<(H, N)>
fn best_chain_containing(&self, base: H) -> Option<(H, N)>
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
.