sp_subspace_mmr

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", so this trait is not object safe.

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§