From 32980082d17a4403aa1b3e4783754d0a3b2a9abf Mon Sep 17 00:00:00 2001 From: dbanks12 Date: Fri, 26 Jan 2024 21:39:21 +0000 Subject: [PATCH] prettier --- .../acir-simulator/src/avm/opcodes/encode_to_bytecode.ts | 6 ++++-- yarn-project/acir-simulator/src/avm/opcodes/memory.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/yarn-project/acir-simulator/src/avm/opcodes/encode_to_bytecode.ts b/yarn-project/acir-simulator/src/avm/opcodes/encode_to_bytecode.ts index 186706847d3..105c0f808ab 100644 --- a/yarn-project/acir-simulator/src/avm/opcodes/encode_to_bytecode.ts +++ b/yarn-project/acir-simulator/src/avm/opcodes/encode_to_bytecode.ts @@ -11,12 +11,14 @@ import { Opcode } from './opcodes.js'; export function encodeToBytecode(opcode: Opcode, args: number[]): Buffer { const instructionType = INSTRUCTION_SET.get(opcode); if (instructionType === undefined) { - throw new Error(`Opcode ${opcode} not implemented`); + throw new Error(`Opcode 0x${opcode.toString(16)} not implemented`); } const numberOfOperands = instructionType.numberOfOperands; if (args.length !== numberOfOperands) { - throw new Error(`Opcode ${opcode} expects ${numberOfOperands} arguments, but ${args.length} were provided`); + throw new Error( + `Opcode 0x${opcode.toString(16)} expects ${numberOfOperands} arguments, but ${args.length} were provided`, + ); } const bytecode = Buffer.alloc(AVM_OPCODE_BYTE_LENGTH + numberOfOperands * AVM_OPERAND_BYTE_LENGTH); diff --git a/yarn-project/acir-simulator/src/avm/opcodes/memory.ts b/yarn-project/acir-simulator/src/avm/opcodes/memory.ts index 6463b496175..2524684dc02 100644 --- a/yarn-project/acir-simulator/src/avm/opcodes/memory.ts +++ b/yarn-project/acir-simulator/src/avm/opcodes/memory.ts @@ -7,12 +7,12 @@ export class Set extends Instruction { static type: string = 'SET'; static numberOfOperands = 3; - constructor(private dstTag: TypeTag, private value: bigint, private dstOffset: number) { + constructor(private inTag: TypeTag, private value: bigint, private dstOffset: number) { super(); } async execute(machineState: AvmMachineState, _journal: AvmJournal): Promise { - const res = TaggedMemory.integralFromTag(this.value, this.dstTag); + const res = TaggedMemory.integralFromTag(this.value, this.inTag); machineState.memory.set(this.dstOffset, res);