diff --git a/yarn-project/end-to-end/src/e2e_event_logs.test.ts b/yarn-project/end-to-end/src/e2e_event_logs.test.ts index 53e0c629575..8a921af5097 100644 --- a/yarn-project/end-to-end/src/e2e_event_logs.test.ts +++ b/yarn-project/end-to-end/src/e2e_event_logs.test.ts @@ -37,7 +37,7 @@ describe('Logs', () => { afterAll(() => teardown()); describe('functionality around emitting an encrypted log', () => { - it.skip('emits multiple events as encrypted logs and decodes them one manually', async () => { + it('emits multiple events as encrypted logs and decodes them one manually', async () => { const randomness = makeTuple(2, Fr.random); const preimage = makeTuple(4, Fr.random); @@ -68,31 +68,31 @@ describe('Logs', () => { expect(event0?.value0).toStrictEqual(preimage[0].toBigInt()); expect(event0?.value1).toStrictEqual(preimage[1].toBigInt()); - // We check that an event that does not match, is not decoded correctly due to an event type id mismatch - const badEvent0 = event0Metadata.decode(decryptedEvent0); - expect(badEvent0).toBe(undefined); - const decryptedEvent1 = L1EventPayload.decryptAsIncoming(encryptedLogs[2], wallets[0].getEncryptionSecret())!; - expect(decryptedEvent1.contractAddress).toStrictEqual(testLogContract.address); - expect(decryptedEvent1.randomness).toStrictEqual(randomness[1]); - expect(decryptedEvent1.eventTypeId).toStrictEqual(EventSelector.fromSignature('ExampleEvent1((Field),u8)')); - - // We check our second event, which is a different type const event1Metadata = new EventMetadata( EventType.Encrypted, TestLogContract.events.ExampleEvent1, ); + // We check our second event, which is a different type const event1 = event1Metadata.decode(decryptedEvent1); + // We check that an event that does not match, is not decoded correctly due to an event type id mismatch + const badEvent0 = event1Metadata.decode(decryptedEvent0); + expect(badEvent0).toBe(undefined); + + expect(decryptedEvent1.contractAddress).toStrictEqual(testLogContract.address); + expect(decryptedEvent1.randomness).toStrictEqual(randomness[1]); + expect(decryptedEvent1.eventTypeId).toStrictEqual(EventSelector.fromSignature('ExampleEvent1((Field),u8)')); + // We expect the fields to have been populated correctly expect(event1?.value2).toStrictEqual(preimage[2]); // We get the last byte here because value3 is of type u8 expect(event1?.value3).toStrictEqual(BigInt(preimage[3].toBuffer().subarray(31).readUint8())); // Again, trying to decode another event with mismatching data does not yield anything - const badEvent1 = event1Metadata.decode(decryptedEvent1); + const badEvent1 = event0Metadata.decode(decryptedEvent1); expect(badEvent1).toBe(undefined); });