From c1dc6eefed5408da3b88e600ef44b92b014a3d32 Mon Sep 17 00:00:00 2001 From: ejMina226 <118474890+ejMina226@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:53:32 +0000 Subject: [PATCH] Change getPathLessOrEqual to include equal --- packages/common/src/trees/InMemoryLinkedMerkleTreeStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/trees/InMemoryLinkedMerkleTreeStorage.ts b/packages/common/src/trees/InMemoryLinkedMerkleTreeStorage.ts index 5626c0d1..b59a8b37 100644 --- a/packages/common/src/trees/InMemoryLinkedMerkleTreeStorage.ts +++ b/packages/common/src/trees/InMemoryLinkedMerkleTreeStorage.ts @@ -45,7 +45,7 @@ export class InMemoryLinkedMerkleTreeStorage implements LinkedMerkleTreeStore { public getPathLessOrEqual(path: number): LinkedLeaf { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions let largestLeaf = this.getLeaf(0n) as LinkedLeaf; - while (largestLeaf.nextPath < path) { + while (largestLeaf.nextPath <= path) { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions const nextIndex = this.getLeafIndex(largestLeaf.nextPath) as bigint; // eslint-disable-next-line @typescript-eslint/consistent-type-assertions