Skip to content

Commit

Permalink
chore: rename to simulate
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 30, 2024
1 parent e56a97c commit d8c1a0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions yarn-project/acir-simulator/src/avm/avm_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/acir-simulator/src/avm/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AvmJournal>;
Expand All @@ -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();
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [],
Expand Down

0 comments on commit d8c1a0e

Please sign in to comment.