Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilaWang committed Aug 22, 2024
1 parent 18de45c commit 8d2a954
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions yarn-project/simulator/src/public/hints_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class HintsBuilder {
readRequests,
MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
NOTE_HASH_TREE_HEIGHT,
MerkleTreeId.NOTE_HASH_TREE,
);
}

Expand Down Expand Up @@ -74,6 +75,7 @@ export class HintsBuilder {
readRequests,
MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX,
L1_TO_L2_MSG_TREE_HEIGHT,
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
);
}

Expand Down Expand Up @@ -161,17 +163,15 @@ export class HintsBuilder {
private async getTreeLeafReadRequestsHints<N extends number, TREE_HEIGHT extends number>(
readRequests: Tuple<TreeLeafReadRequest, N>,
size: N,
height: TREE_HEIGHT,
treeHeight: TREE_HEIGHT,
treeId: MerkleTreeId,
): Promise<Tuple<TreeLeafReadRequestHint<TREE_HEIGHT>, N>> {
const hints = makeTuple(size, () => TreeLeafReadRequestHint.empty(height));
const hints = makeTuple(size, () => TreeLeafReadRequestHint.empty(treeHeight));
for (let i = 0; i < readRequests.length; i++) {
const request = readRequests[i];
if (!request.isEmpty()) {
const siblingPath = await this.db.getSiblingPath<typeof height>(
MerkleTreeId.NOTE_HASH_TREE,
request.leafIndex.toBigInt(),
);
hints[i] = new TreeLeafReadRequestHint(height, siblingPath.toTuple());
const siblingPath = await this.db.getSiblingPath<typeof treeHeight>(treeId, request.leafIndex.toBigInt());
hints[i] = new TreeLeafReadRequestHint(treeHeight, siblingPath.toTuple());
}
}
return hints;
Expand Down

0 comments on commit 8d2a954

Please sign in to comment.