From 662b3e9ae80026fbb74619b9f51ac4ea19d2b770 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 17 Sep 2024 17:17:51 +0000 Subject: [PATCH] fixes --- .../bb-prover/src/avm_proving.test.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/yarn-project/bb-prover/src/avm_proving.test.ts b/yarn-project/bb-prover/src/avm_proving.test.ts index 7ff6ff83ce5..6444b8b01eb 100644 --- a/yarn-project/bb-prover/src/avm_proving.test.ts +++ b/yarn-project/bb-prover/src/avm_proving.test.ts @@ -1,8 +1,15 @@ import { GlobalVariables } from '@aztec/circuits.js'; import { Fr } from '@aztec/foundation/fields'; + + +import { mock } from 'jest-mock-extended'; + + + import { proveAndVerifyAvmTestContract } from '../src/test/test_avm.js'; + const TIMEOUT = 60_000; const TIMESTAMP = new Fr(99833); const GLOBAL_VARIABLES = GlobalVariables.empty(); @@ -30,7 +37,7 @@ describe('AVM WitGen, proof generation and verification', () => { it.each(avmFunctionsAndCalldata)( 'Should prove %s', async (name, calldata) => { - await proveAndVerifyAvmTestContract(name, calldata); + await proveAndVerifyAvmTestContract(jest, mock, name, calldata); }, TIMEOUT, ); @@ -76,7 +83,7 @@ describe('AVM WitGen, proof generation and verification', () => { it.each(avmHashFunctions)( 'Should prove %s', async (name, calldata) => { - await proveAndVerifyAvmTestContract(name, calldata); + await proveAndVerifyAvmTestContract(jest, mock, name, calldata); }, TIMEOUT * 2, // We need more for keccak for now ); @@ -85,7 +92,7 @@ describe('AVM WitGen, proof generation and verification', () => { it( 'Should prove that timestamp matches', async () => { - await proveAndVerifyAvmTestContract('assert_timestamp', [TIMESTAMP], undefined, GLOBAL_VARIABLES); + await proveAndVerifyAvmTestContract(jest, mock, 'assert_timestamp', [TIMESTAMP], undefined, GLOBAL_VARIABLES); }, TIMEOUT, ); @@ -95,6 +102,8 @@ describe('AVM WitGen, proof generation and verification', () => { async () => { // The error assertion string must match with that of assert_timestamp noir function. await proveAndVerifyAvmTestContract( + jest, + mock, 'assert_timestamp', [TIMESTAMP.add(new Fr(1))], 'timestamp does not match', @@ -116,7 +125,7 @@ describe('AVM WitGen, proof generation and verification', () => { it.each(avmEmbeddedCurveFunctions)( 'Should prove %s', async (name, calldata) => { - await proveAndVerifyAvmTestContract(name, calldata); + await proveAndVerifyAvmTestContract(jest, mock, name, calldata); }, TIMEOUT, ); @@ -145,9 +154,9 @@ describe('AVM WitGen, proof generation and verification', () => { it.each(avmContextFunctions)( 'Should prove %s', async contextFunction => { - await proveAndVerifyAvmTestContract(contextFunction); + await proveAndVerifyAvmTestContract(jest, mock, contextFunction); }, TIMEOUT, ); }); -}); +}); \ No newline at end of file