Struct binary_merkle_tree::MerkleProof
source · pub struct MerkleProof<H, L> {
pub root: H,
pub proof: Vec<H>,
pub number_of_leaves: usize,
pub leaf_index: usize,
pub leaf: L,
}
Expand description
A generated merkle proof.
The structure contains all necessary data to later on verify the proof and the leaf itself.
Fields§
§root: H
Root hash of generated merkle tree.
proof: Vec<H>
Proof items (does not contain the leaf hash, nor the root obviously).
This vec contains all inner node hashes necessary to reconstruct the root hash given the leaf hash.
number_of_leaves: usize
Number of leaves in the original tree.
This is needed to detect a case where we have an odd number of leaves that “get promoted” to upper layers.
leaf_index: usize
Index of the leaf the proof is for (0-based).
leaf: L
Leaf content.
Trait Implementations§
source§impl<H: PartialEq, L: PartialEq> PartialEq<MerkleProof<H, L>> for MerkleProof<H, L>
impl<H: PartialEq, L: PartialEq> PartialEq<MerkleProof<H, L>> for MerkleProof<H, L>
source§fn eq(&self, other: &MerkleProof<H, L>) -> bool
fn eq(&self, other: &MerkleProof<H, L>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.