Interface IMerkleTree

Defines the interface for a Merkle tree.

interface IMerkleTree {
    commit(): Promise<void>;
    getDepth(): number;
    getLeafValue(index, includeUncommitted): Promise<undefined | Field>;
    getNumLeaves(includeUncommitted): bigint;
    getRoot(includeUncommitted): Field;
    getSiblingPath(index, includeUncommitted): Promise<BaseSiblingPath>;
    rollback(): Promise<void>;
}

Hierarchy (view full)

Methods

  • Returns the value of a leaf at the specified index.

    Parameters

    • index: bigint

      The index of the leaf value to be returned.

    • includeUncommitted: boolean

      Set to true to include uncommitted updates in the data set.

    Returns Promise<undefined | Field>

  • Returns the number of leaves in the tree.

    Parameters

    • includeUncommitted: boolean

      Set to true to include uncommitted updates in the returned value.

    Returns bigint

  • Returns the current root of the tree.

    Parameters

    • includeUncommitted: boolean

      Set to true to include uncommitted updates in the calculated root.

    Returns Field