From 9347062f91bc88742074ddd06ec3fbbf7fa21778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 11 Apr 2024 14:00:29 +0000 Subject: [PATCH 1/4] Fix max-block-number --- .../src/e2e_max_block_number.test.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts index b7c78ff4dde..0dbc36153d7 100644 --- a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts +++ b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts @@ -28,9 +28,9 @@ describe('e2e_max_block_number', () => { const enqueuePublicCall = false; it('sets the max block number', async () => { - const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).simulate(); - expect(tx.data.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('does not invalidate the transaction', async () => { @@ -42,9 +42,9 @@ describe('e2e_max_block_number', () => { const enqueuePublicCall = true; it('sets the max block number', async () => { - const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).simulate(); - expect(tx.data.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('does not invalidate the transaction', async () => { @@ -64,9 +64,9 @@ describe('e2e_max_block_number', () => { const enqueuePublicCall = false; it('sets the max block number', async () => { - const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).simulate(); - expect(tx.data.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('invalidates the transaction', async () => { @@ -80,9 +80,9 @@ describe('e2e_max_block_number', () => { const enqueuePublicCall = true; it('sets the max block number', async () => { - const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).simulate(); - expect(tx.data.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('invalidates the transaction', async () => { From c1f12031d787e1abc23c1bbe761bd8e8a99d5b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 11 Apr 2024 14:01:41 +0000 Subject: [PATCH 2/4] Fix e2e-auth-contract --- yarn-project/end-to-end/src/e2e_auth_contract.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_auth_contract.test.ts b/yarn-project/end-to-end/src/e2e_auth_contract.test.ts index a5a3da14d14..b2568365140 100644 --- a/yarn-project/end-to-end/src/e2e_auth_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_auth_contract.test.ts @@ -83,7 +83,7 @@ describe('e2e_auth_contract', () => { const interaction = contract.withWallet(authorized).methods.do_private_authorized_thing(VALUE); - const tx = await interaction.simulate(); + const tx = await interaction.prove(); const lastBlockNumber = await pxe.getBlockNumber(); // In the last block there was no scheduled value change, so the earliest one could be scheduled is in the next @@ -91,8 +91,8 @@ describe('e2e_auth_contract', () => { // horizon should be the block preceding that one. const expectedMaxBlockNumber = lastBlockNumber + DELAY; - expect(tx.data.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(expectedMaxBlockNumber)); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(expectedMaxBlockNumber)); await assertLoggedNumber(interaction, VALUE); }); From 6e49bcd1cc0c824f056b123d157c9013270d73ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 11 Apr 2024 14:10:28 +0000 Subject: [PATCH 3/4] Add auth contract to earthly --- yarn-project/end-to-end/Earthfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 20a59e4b78c..155497de31b 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -86,6 +86,10 @@ e2e-2-pxes: ARG e2e_mode=local DO +E2E_TEST --test=e2e_2_pxes.test.ts --e2e_mode=$e2e_mode +e2e-auth-contract: + ARG e2e_mode=local + DO +E2E_TEST --test=e2e_auth_contract.test.ts --e2e_mode=$e2e_mode + e2e-note-getter: ARG e2e_mode=local DO +E2E_TEST --test=e2e_note_getter.test.ts --e2e_mode=$e2e_mode From 0edf4ee234b7263763a44a2e781152770dfc3249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 11 Apr 2024 14:49:32 +0000 Subject: [PATCH 4/4] Fix tests with enqueued public calls --- yarn-project/end-to-end/src/e2e_max_block_number.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts index 0dbc36153d7..a02bf72703c 100644 --- a/yarn-project/end-to-end/src/e2e_max_block_number.test.ts +++ b/yarn-project/end-to-end/src/e2e_max_block_number.test.ts @@ -43,8 +43,8 @@ describe('e2e_max_block_number', () => { it('sets the max block number', async () => { const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); - expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + expect(tx.data.forPublic!.validationRequests.forRollup.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forPublic!.validationRequests.forRollup.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('does not invalidate the transaction', async () => { @@ -81,8 +81,8 @@ describe('e2e_max_block_number', () => { it('sets the max block number', async () => { const tx = await contract.methods.request_max_block_number(maxBlockNumber, enqueuePublicCall).prove(); - expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.isSome).toEqual(true); - expect(tx.data.forRollup!.rollupValidationRequests.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); + expect(tx.data.forPublic!.validationRequests.forRollup.maxBlockNumber.isSome).toEqual(true); + expect(tx.data.forPublic!.validationRequests.forRollup.maxBlockNumber.value).toEqual(new Fr(maxBlockNumber)); }); it('invalidates the transaction', async () => {