Skip to main content

MmrProofVerifier

Trait MmrProofVerifier 

Source
pub trait MmrProofVerifier<MmrHash, CBlockNumber: Decode, CBlockHash: Decode> {
    // Required method
    fn verify_proof_and_extract_leaf(
        mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>,
    ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>;

    // Provided methods
    fn verify_proof_stateless(
        _mmr_root: MmrHash,
        _mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>,
    ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>> { ... }
    fn extract_leaf_without_verifying(
        mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>,
    ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>> { ... }
}
Expand description

Trait to verify MMR proofs

Required Methods§

Source

fn verify_proof_and_extract_leaf( mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>, ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>

Returns consensus state root if the given MMR proof is valid

Provided Methods§

Source

fn verify_proof_stateless( _mmr_root: MmrHash, _mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>, ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>

Source

fn extract_leaf_without_verifying( mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>, ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<MmrHash, CBlockNumber: Decode, CBlockHash: Decode> MmrProofVerifier<MmrHash, CBlockNumber, CBlockHash> for ()

Source§

fn verify_proof_and_extract_leaf( _mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>, ) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>

Implementors§