From dfd870d584c276aa4fd3edf09fc452e0cca96e83 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 1 Feb 2024 11:53:55 +0000 Subject: [PATCH] test fix --- yarn-project/acir-simulator/src/public/index.test.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/yarn-project/acir-simulator/src/public/index.test.ts b/yarn-project/acir-simulator/src/public/index.test.ts index be71abc0b4b..e96cd2ecaa9 100644 --- a/yarn-project/acir-simulator/src/public/index.test.ts +++ b/yarn-project/acir-simulator/src/public/index.test.ts @@ -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));