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