Constructors
Private
constructor
- new MerkleTree<V>(root, store, height, valueType, hasher, hashValue): MerkleTree<V>
Parameters
- root: Field
- store: Store<V>
- height: number
- valueType: Provable<V>
- hasher: Hasher
- hashValue: boolean
Properties
Protected
Readonly
hashValue
hashValue: boolean
Protected
Readonly
height
height: number
Protected
Readonly
maxNumIndex
maxNumIndex: bigint
Protected
root
root: Field
Methods
clear
- clear(): Promise<void>
Returns Promise<void>
{Promise}
delete
- delete(index): Promise<Field>
Returns Promise<Field>
{Promise}
depth
- depth(): number
Returns number
{number}
Protected
digest
- digest(data): Field
Returns Field
get
- get(index): Promise<null | V>
Returns Promise<null | V>
{(Promise<V | null>)}
getRoot
- getRoot(): Field
Returns Field
{Field}
has
- has(index): Promise<boolean>
Returns Promise<boolean>
{Promise}
isEmpty
- isEmpty(): boolean
Returns boolean
{boolean}
setRoot
- setRoot(root): Promise<void>
Returns Promise<void>
Protected
sideNodesForRoot
- sideNodesForRoot(root, path): Promise<{
leafData: Field;
pathNodes: Field[];
sideNodes: Field[];
}> Returns Promise<{
leafData: Field;
pathNodes: Field[];
sideNodes: Field[];
}>
update
- update(index, value?): Promise<Field>
Parameters
- index: bigint
Optional
value: V
Returns Promise<Field>
{Promise}
updateAll
- updateAll(ivs): Promise<Field>
Parameters
- ivs: {
index: bigint;
value?: V;
}[]
Returns Promise<Field>
{Promise}
Protected
updateForRoot
- updateForRoot(root, key, value?): Promise<Field>
Parameters
- root: Field
- key: bigint
Optional
value: V
Returns Promise<Field>
Protected
updateWithSideNodes
- updateWithSideNodes(sideNodes, pathNodes, oldLeafData, path, value?): Field
Parameters
- sideNodes: Field[]
- pathNodes: Field[]
- oldLeafData: Field
- path: Field
Optional
value: V
Returns Field
Static
build
- build<V>(store, height, valueType, options?): Promise<MerkleTree<V>>
Parameters
- store: Store<V>
- height: number
- valueType: Provable<V>
Optional
options: {
hashValue?: boolean;
hasher?: Hasher;
} = ...Optional
hashValue?: boolean
Optional
hasher?: Hasher
{Promise<MerkleTree>}
Static
import
- import<V>(store, height, valueType, options?): Promise<MerkleTree<V>>
Parameters
- store: Store<V>
- height: number
- valueType: Provable<V>
Optional
options: {
hashValue?: boolean;
hasher?: Hasher;
} = ...Optional
hashValue?: boolean
Optional
hasher?: Hasher
{Promise<MerkleTree>}
Merkle Tree.
MerkleTree