Struct accumulator::MerkleAccumulator[][src]

pub struct MerkleAccumulator<R, H> { /* fields omitted */ }
Expand description

In this live Merkle Accumulator algorithms.

Implementations

Given an existing Merkle Accumulator (represented by num_existing_leaves and a reader that is able to fetch all existing frozen nodes), and a list of leaves to be appended, returns the result root hash and new nodes to be frozen.

Get proof of inclusion of the leaf at leaf_index in this Merkle Accumulator of num_leaves leaves in total. Siblings are read via reader (or generated dynamically if they are non-frozen).

See diem_types::proof::AccumulatorProof for proof format.

Gets a proof that shows the full accumulator is consistent with a smaller accumulator.

See diem_types::proof::AccumulatorConsistencyProof for proof format.

Gets a proof that shows a range of leaves are part of the accumulator.

See diem_types::proof::AccumulatorRangeProof for proof format.

See get_range_proof. This is the version of it that returns Positions only.

From left to right, gets frozen subtree root hashes of the accumulator. For example, if the accumulator has 5 leaves, x and e are returned.

                root
               /    \
             /        \
           /            \
          x              o
        /   \           / \
       /     \         /   \
      o       o       o     placeholder
     / \     / \     / \
    a   b   c   d   e   placeholder

Get root hash at a specific version (hence num_leaves).

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.

Should always be Self

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.