Struct beefy_merkle_tree::MerkleProof[][src]

pub struct MerkleProof<T> {
    pub root: Hash,
    pub proof: Vec<Hash>,
    pub number_of_leaves: usize,
    pub leaf_index: usize,
    pub leaf: T,
}
Expand description

A generated merkle proof.

The structure contains all necessary data to later on verify the proof and the leaf itself.

Fields

root: Hash

Root hash of generated merkle tree.

proof: Vec<Hash>

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: T

Leaf content.

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.