mithril_common::crypto_helper

Trait MKMapValue

source
pub trait MKMapValue<K: MKMapKey>:
    Clone
    + TryInto<MKTreeNode>
    + TryFrom<MKTreeNode> {
    // Required methods
    fn compute_root(&self) -> StdResult<MKTreeNode>;
    fn contains<T: Into<MKTreeNode> + Clone>(&self, leaf: &T) -> bool;
    fn can_compute_proof(&self) -> bool;
    fn compute_proof<T: Into<MKTreeNode> + Clone>(
        &self,
        leaves: &[T],
    ) -> StdResult<Option<MKMapProof<K>>>;
}
Expand description

The trait implemented by the values of a MKMap

Required Methods§

source

fn compute_root(&self) -> StdResult<MKTreeNode>

Get the root of the merkelized map value

source

fn contains<T: Into<MKTreeNode> + Clone>(&self, leaf: &T) -> bool

Check if the merkelized map value contains a leaf

source

fn can_compute_proof(&self) -> bool

Can the merkelized map value compute a proof

source

fn compute_proof<T: Into<MKTreeNode> + Clone>( &self, leaves: &[T], ) -> StdResult<Option<MKMapProof<K>>>

Compute the proof for a set of values of the merkelized map

Object Safety§

This trait is not object safe.

Implementors§