Skip to content

Commit

Permalink
no check leaf.value=0 within level.js api
Browse files Browse the repository at this point in the history
  • Loading branch information
coldstar1993 committed Nov 23, 2023
1 parent c0aacdd commit 2b317d6
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,20 +379,7 @@ export class StandardIndexedTree extends TreeBase implements IndexedTree {
* @param index - The index of the element.
*/
public async updateLeafWithNoValueCheck(leaf: LeafData, index: bigint): Promise<void> {
let encodedLeaf;
// === origin code block ===
/*
if (leaf.value == 0n) {
encodedLeaf = Field(0);
} else {
encodedLeaf = hashEncodedTreeValue(leaf, this.hasher);
}
*/
// === origin code block ===

// === new code block ===
encodedLeaf = hashEncodedTreeValue(leaf, this.hasher);
// === new code block ===
let encodedLeaf = hashEncodedTreeValue(leaf, this.hasher);

this.cachedLeaves[Number(index)] = leaf;
await this._updateLeaf(encodedLeaf, index);
Expand Down

0 comments on commit 2b317d6

Please sign in to comment.