Trait sp_consensus_beefy::AncestryHelper
source · pub trait AncestryHelper<Header: HeaderT> {
type Proof: Clone + Debug + Decode + Encode + PartialEq + TypeInfo;
type ValidationContext;
// Required methods
fn generate_proof(
prev_block_number: Header::Number,
best_known_block_number: Option<Header::Number>,
) -> Option<Self::Proof>;
fn extract_validation_context(
header: Header,
) -> Option<Self::ValidationContext>;
fn is_non_canonical(
commitment: &Commitment<Header::Number>,
proof: Self::Proof,
context: Self::ValidationContext,
) -> bool;
}
Expand description
Hook containing helper methods for proving/checking commitment canonicity.
Required Associated Types§
sourcetype Proof: Clone + Debug + Decode + Encode + PartialEq + TypeInfo
type Proof: Clone + Debug + Decode + Encode + PartialEq + TypeInfo
Type containing proved info about the canonical chain at a certain height.
sourcetype ValidationContext
type ValidationContext
The data needed for validating the proof.
Required Methods§
sourcefn generate_proof(
prev_block_number: Header::Number,
best_known_block_number: Option<Header::Number>,
) -> Option<Self::Proof>
fn generate_proof( prev_block_number: Header::Number, best_known_block_number: Option<Header::Number>, ) -> Option<Self::Proof>
Generates a proof that the prev_block_number
is part of the canonical chain at
best_known_block_number
.
sourcefn extract_validation_context(header: Header) -> Option<Self::ValidationContext>
fn extract_validation_context(header: Header) -> Option<Self::ValidationContext>
Extract the validation context from the provided header.
sourcefn is_non_canonical(
commitment: &Commitment<Header::Number>,
proof: Self::Proof,
context: Self::ValidationContext,
) -> bool
fn is_non_canonical( commitment: &Commitment<Header::Number>, proof: Self::Proof, context: Self::ValidationContext, ) -> bool
Check if a commitment is pointing to a header on a non-canonical chain against a canonicity proof generated at the same header height.
Object Safety§
This trait is not object safe.