Function loadTree

  • Creates a new tree and sets its root, depth and size based on the meta data which are associated with the name.

    Type Parameters

    • T extends TreeBase

    Parameters

    • c: (new (...args) => T)

      The class of the tree to be instantiated.

        • new (...args): T
        • Parameters

          • Rest ...args: any[]

          Returns T

    • db: Level<string, Buffer>

      A database used to store the Merkle tree data.

    • hasher: Hasher

      A hasher used to compute hash paths.

    • name: string

      Name of the tree.

    Returns Promise<T>

    The newly created tree.