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§
sourcefn verify_proof_and_extract_leaf(
mmr_leaf_proof: ConsensusChainMmrLeafProof<CBlockNumber, CBlockHash, MmrHash>,
) -> Option<MmrLeaf<CBlockNumber, CBlockHash>>
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§
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>>
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.