pub trait SubspaceMmrHostFunctions: Send + Sync {
// Required methods
fn get_mmr_leaf_data(&self, consensus_block_hash: H256) -> Option<LeafData>;
fn verify_mmr_proof(
&self,
leaves: Vec<EncodableOpaqueLeaf>,
encoded_proof: Vec<u8>,
) -> bool;
fn consensus_block_hash(&self, block_number: BlockNumber) -> Option<H256>;
fn is_consensus_block_finalized(&self, block_number: BlockNumber) -> bool;
}
Expand description
Trait to query MMR specific data through host function..
Required Methods§
sourcefn get_mmr_leaf_data(&self, consensus_block_hash: H256) -> Option<LeafData>
fn get_mmr_leaf_data(&self, consensus_block_hash: H256) -> Option<LeafData>
Returns the MMR Leaf data for given consensus block hash
sourcefn verify_mmr_proof(
&self,
leaves: Vec<EncodableOpaqueLeaf>,
encoded_proof: Vec<u8>,
) -> bool
fn verify_mmr_proof( &self, leaves: Vec<EncodableOpaqueLeaf>, encoded_proof: Vec<u8>, ) -> bool
Verifies the mmr proof using consensus chain.
sourcefn consensus_block_hash(&self, block_number: BlockNumber) -> Option<H256>
fn consensus_block_hash(&self, block_number: BlockNumber) -> Option<H256>
Returns the consensus block hash for given block number.