Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Feb 26, 2024
1 parent 5e69b25 commit de68246
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/merkletree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export abstract class MerkleTreeImpl<T> implements MerkleTree<T> {

private _verifyAndHash(index: number): HexString {
validateArgument(this.values.at(index) !== undefined, 'Index out of bounds');
const { value: leaf, treeIndex } = this.values[index]!;
const hashedLeaf = this.leafHash(leaf);
const { value, treeIndex } = this.values[index]!;
const hashedLeaf = this.leafHash(value);
invariant(this.tree.at(treeIndex) === hashedLeaf, 'Merkle tree does not contain the expected value');
return hashedLeaf;
}
Expand Down

0 comments on commit de68246

Please sign in to comment.