diff --git a/yarn-project/acir-simulator/src/avm/avm_context.ts b/yarn-project/acir-simulator/src/avm/avm_context.ts index 256bfefacdf..0fcb86cfde6 100644 --- a/yarn-project/acir-simulator/src/avm/avm_context.ts +++ b/yarn-project/acir-simulator/src/avm/avm_context.ts @@ -4,7 +4,7 @@ import { Fr } from '@aztec/foundation/fields'; import { AvmExecutionEnvironment } from './avm_execution_environment.js'; import { AvmMachineState } from './avm_machine_state.js'; import { AvmMessageCallResult } from './avm_message_call_result.js'; -import { AvmInterpreterError, interpretAvm } from './interpreter/index.js'; +import { AvmInterpreterError, executeAvm } from './interpreter/index.js'; import { AvmJournal } from './journal/journal.js'; import { decodeBytecode } from './opcodes/decode_bytecode.js'; import { Instruction } from './opcodes/index.js'; @@ -50,7 +50,7 @@ export class AvmContext { const instructions: Instruction[] = decodeBytecode(bytecode); const machineState = new AvmMachineState(this.executionEnvironment); - return interpretAvm(machineState, this.journal, instructions); + return executeAvm(machineState, this.journal, instructions); } /** diff --git a/yarn-project/acir-simulator/src/avm/index.test.ts b/yarn-project/acir-simulator/src/avm/index.test.ts index 421f9c37699..8fb3a49dab0 100644 --- a/yarn-project/acir-simulator/src/avm/index.test.ts +++ b/yarn-project/acir-simulator/src/avm/index.test.ts @@ -4,7 +4,7 @@ import { mock } from 'jest-mock-extended'; import { AvmMachineState } from './avm_machine_state.js'; import { initExecutionEnvironment } from './fixtures/index.js'; -import { interpretAvm } from './interpreter/interpreter.js'; +import { executeAvm } from './interpreter/interpreter.js'; import { AvmJournal } from './journal/journal.js'; import { decodeBytecode } from './opcodes/decode_bytecode.js'; import { encodeToBytecode } from './opcodes/encode_to_bytecode.js'; @@ -30,7 +30,7 @@ describe('avm', () => { // Execute instructions const context = new AvmMachineState(initExecutionEnvironment({ calldata })); - const avmReturnData = await interpretAvm(context, journal, instructions); + const avmReturnData = await executeAvm(context, journal, instructions); expect(avmReturnData.reverted).toBe(false); diff --git a/yarn-project/acir-simulator/src/avm/interpreter/interpreter.test.ts b/yarn-project/acir-simulator/src/avm/interpreter/interpreter.test.ts index 06137e2df3a..e5055cdf903 100644 --- a/yarn-project/acir-simulator/src/avm/interpreter/interpreter.test.ts +++ b/yarn-project/acir-simulator/src/avm/interpreter/interpreter.test.ts @@ -9,7 +9,7 @@ import { Add } from '../opcodes/arithmetic.js'; import { Jump, Return } from '../opcodes/control_flow.js'; import { Instruction } from '../opcodes/instruction.js'; import { CalldataCopy } from '../opcodes/memory.js'; -import { InvalidProgramCounterError, interpretAvm } from './interpreter.js'; +import { InvalidProgramCounterError, executeAvm } from './interpreter.js'; describe('interpreter', () => { let journal: MockProxy; @@ -28,7 +28,7 @@ describe('interpreter', () => { ]; const machineState = new AvmMachineState(initExecutionEnvironment({ calldata })); - const avmReturnData = await interpretAvm(machineState, journal, instructions); + const avmReturnData = await executeAvm(machineState, journal, instructions); expect(avmReturnData.reverted).toBe(false); expect(avmReturnData.revertReason).toBeUndefined(); @@ -43,7 +43,7 @@ describe('interpreter', () => { const instructions: Instruction[] = [new Jump(invalidJumpDestination)]; const machineState = new AvmMachineState(initExecutionEnvironment({ calldata })); - const avmReturnData = await interpretAvm(machineState, journal, instructions); + const avmReturnData = await executeAvm(machineState, journal, instructions); expect(avmReturnData.reverted).toBe(true); expect(avmReturnData.revertReason).toBeInstanceOf(InvalidProgramCounterError); diff --git a/yarn-project/acir-simulator/src/avm/interpreter/interpreter.ts b/yarn-project/acir-simulator/src/avm/interpreter/interpreter.ts index f344ce57a18..86385078cac 100644 --- a/yarn-project/acir-simulator/src/avm/interpreter/interpreter.ts +++ b/yarn-project/acir-simulator/src/avm/interpreter/interpreter.ts @@ -11,7 +11,7 @@ import { Instruction } from '../opcodes/index.js'; * - reverted execution will return false * - any other panic will throw */ -export async function interpretAvm( +export async function executeAvm( machineState: AvmMachineState, journal: AvmJournal, instructions: Instruction[] = [],