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 for MerkleProof<H, L>
impl<H: PartialEq, L: PartialEq> PartialEq 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 ==
.impl<H: Eq, L: Eq> Eq for MerkleProof<H, L>
impl<H, L> StructuralEq for MerkleProof<H, L>
impl<H, L> StructuralPartialEq for MerkleProof<H, L>
Auto Trait Implementations§
impl<H, L> RefUnwindSafe for MerkleProof<H, L>where
H: RefUnwindSafe,
L: RefUnwindSafe,
impl<H, L> Send for MerkleProof<H, L>
impl<H, L> Sync for MerkleProof<H, L>
impl<H, L> Unpin for MerkleProof<H, L>
impl<H, L> UnwindSafe for MerkleProof<H, L>where
H: UnwindSafe,
L: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more