Skip to content

Commit

Permalink
chore(avm): formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasRidhuan committed Apr 10, 2024
1 parent 773a1f2 commit e332a4c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions yarn-project/simulator/src/public/avm_executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { AvmTestContractArtifact } from '@aztec/noir-contracts.js';

import { type MockProxy, mock } from 'jest-mock-extended';

import { initContext, initExecutionEnvironment } from '../avm/fixtures/index.js';
import { type CommitmentsDB, type PublicContractsDB, type PublicStateDB } from './db.js';
import { type PublicExecution } from './execution.js';
import { PublicExecutor } from './executor.js';
import { initContext, initExecutionEnvironment } from '../avm/fixtures/index.js';

describe('AVM WitGen and Proof Generation', () => {
let publicState: MockProxy<PublicStateDB>;
Expand Down Expand Up @@ -43,11 +43,16 @@ describe('AVM WitGen and Proof Generation', () => {

const functionData = FunctionData.fromAbi(addArtifact);
const args: Fr[] = [new Fr(99), new Fr(12)];
// We call initContext here to load up a AvmExecutionEnvironment that prepends the calldata with the function selector
// We call initContext here to load up a AvmExecutionEnvironment that prepends the calldata with the function selector
// and the args hash. In reality, we should simulate here and get this from the output of the simulation call.
// For now, the interfaces for the PublicExecutor don't quite line up, so we are doing this.
const context = initContext({ env: initExecutionEnvironment({ calldata: args }) });
const execution: PublicExecution = { contractAddress, functionData, args: context.environment.calldata, callContext };
const execution: PublicExecution = {
contractAddress,
functionData,
args: context.environment.calldata,
callContext,
};
const executor = new PublicExecutor(publicState, publicContracts, commitmentsDb, header);
const [proof, vk] = await executor.getAvmProof(execution);
const valid = await executor.verifyAvmProof(vk, proof);
Expand Down

0 comments on commit e332a4c

Please sign in to comment.