Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Sep 17, 2024
1 parent bfc2ce6 commit 662b3e9
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions yarn-project/bb-prover/src/avm_proving.test.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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
);
Expand All @@ -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,
);
Expand All @@ -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',
Expand All @@ -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,
);
Expand Down Expand Up @@ -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,
);
});
});
});

0 comments on commit 662b3e9

Please sign in to comment.