UNPKG

@chainsafe/persistent-merkle-tree

Version:

Merkle tree implemented as a persistent datastructure

11 lines (10 loc) 602 B
import { HashComputationLevel } from "./hashComputation.ts"; import { Node } from "./node.ts"; export declare function subtreeFillToDepth(bottom: Node, depth: number): Node; export declare function subtreeFillToLength(bottom: Node, depth: number, length: number): Node; /** * WARNING: Mutates the provided nodes array. * TODO: Don't mutate the nodes array. * hcByLevel is an output parameter that will be filled with the hash computations if exists. */ export declare function subtreeFillToContents(nodes: Node[], depth: number, hcOffset?: number, hcByLevel?: HashComputationLevel[] | null): Node;