Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Feb 1, 2024
1 parent d1f8846 commit 4edcc65
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions yarn-project/acir-simulator/src/public/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,14 @@ describe('ACIR public execution simulator', () => {
publicContracts.getBytecode.mockResolvedValue(Buffer.from(mintPublicArtifact.bytecode, 'base64'));
publicState.storageRead.mockResolvedValue(Fr.ZERO);

const siblingPathFields = Array(L1_TO_L2_MSG_TREE_HEIGHT).fill(Fr.random());
const siblingPath = new SiblingPath(L1_TO_L2_MSG_TREE_HEIGHT, siblingPathFields);
const siblingPathBuffers = Array(L1_TO_L2_MSG_TREE_HEIGHT)
.fill(Fr.random())
.map(f => f.toBuffer());
const siblingPath = new SiblingPath(L1_TO_L2_MSG_TREE_HEIGHT, siblingPathBuffers);

let root = messageKey ?? preimage.hash();
for (const sibling of siblingPathFields) {
root = Fr.fromBuffer(pedersenHash([root.toBuffer(), sibling.toBuffer()]));
for (const sibling of siblingPathBuffers) {
root = Fr.fromBuffer(pedersenHash([root.toBuffer(), sibling]));
}
commitmentsDb.getL1ToL2Message.mockImplementation(() => {
return Promise.resolve(new MessageLoadOracleInputs(preimage, 0n, siblingPath));
Expand Down

0 comments on commit 4edcc65

Please sign in to comment.