From ee560c32873a085a68288357471b1a54d8cb9c6f Mon Sep 17 00:00:00 2001 From: Facundo Date: Thu, 1 Feb 2024 17:34:35 +0000 Subject: [PATCH] fix(avm): fix SendL2ToL1Message implementation (#4367) fix(avm): fix SendL2ToL1Message implementation Relates to #4002. --- .../acir-simulator/src/avm/opcodes/accrued_substate.test.ts | 2 +- .../acir-simulator/src/avm/opcodes/accrued_substate.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.test.ts b/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.test.ts index 72ff0a7c614..0163b8bea21 100644 --- a/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.test.ts +++ b/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.test.ts @@ -124,7 +124,7 @@ describe('Accrued Substate', () => { const journalState = journal.flush(); const expected = values.map(v => v.toFr()); - expect(journalState.newLogs).toEqual([expected]); + expect(journalState.newL1Messages).toEqual([expected]); }); }); diff --git a/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.ts b/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.ts index 00c78f6879f..1e85dde5d20 100644 --- a/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.ts +++ b/yarn-project/acir-simulator/src/avm/opcodes/accrued_substate.ts @@ -71,7 +71,7 @@ export class EmitUnencryptedLog extends Instruction { } export class SendL2ToL1Message extends Instruction { - static type: string = 'EMITUNENCRYPTEDLOG'; + static type: string = 'SENDL2TOL1MSG'; static readonly opcode: Opcode = Opcode.SENDL2TOL1MSG; // Informs (de)serialization. See Instruction.deserialize. static readonly wireFormat = [OperandType.UINT8, OperandType.UINT8, OperandType.UINT32, OperandType.UINT32]; @@ -86,7 +86,7 @@ export class SendL2ToL1Message extends Instruction { } const msg = machineState.memory.getSlice(this.msgOffset, this.msgSize).map(f => f.toFr()); - journal.writeLog(msg); + journal.writeL1Message(msg); this.incrementPc(machineState); }