diff --git a/yarn-project/end-to-end/src/e2e_block_building.test.ts b/yarn-project/end-to-end/src/e2e_block_building.test.ts index 20e8161f5945..1ba5a691dac5 100644 --- a/yarn-project/end-to-end/src/e2e_block_building.test.ts +++ b/yarn-project/end-to-end/src/e2e_block_building.test.ts @@ -210,7 +210,9 @@ describe('e2e_block_building', () => { it('private -> private', async () => { const nullifier = Fr.random(); await contract.methods.emit_nullifier(nullifier).send().wait(); - await expect(contract.methods.emit_nullifier(nullifier).send().wait()).rejects.toThrow('dropped'); + await expect(contract.methods.emit_nullifier(nullifier).send().wait()).rejects.toThrow( + 'The simulated transaction is unable to be added to state and is invalid.', + ); }); it('public -> public', async () => { @@ -232,7 +234,9 @@ describe('e2e_block_building', () => { it('public -> private', async () => { const nullifier = Fr.random(); await contract.methods.emit_nullifier_public(nullifier).send().wait(); - await expect(contract.methods.emit_nullifier(nullifier).send().wait()).rejects.toThrow('dropped'); + await expect(contract.methods.emit_nullifier(nullifier).send().wait()).rejects.toThrow( + 'The simulated transaction is unable to be added to state and is invalid.', + ); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts index 3c085962cf80..b8a2b2fde7a7 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts @@ -81,7 +81,9 @@ describe('e2e_deploy_contract legacy', () => { const deployer = new ContractDeployer(TestContractArtifact, wallet); await deployer.deploy().send({ contractAddressSalt }).wait({ wallet }); - await expect(deployer.deploy().send({ contractAddressSalt }).wait()).rejects.toThrow(/dropped/); + await expect(deployer.deploy().send({ contractAddressSalt }).wait()).rejects.toThrow( + /The simulated transaction is unable to be added to state and is invalid./, + ); }); it('should not deploy a contract which failed the public part of the execution', async () => { diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/private_initialization.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/private_initialization.test.ts index ca7dff265c2d..8cb6d838b65a 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/private_initialization.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/private_initialization.test.ts @@ -93,7 +93,7 @@ describe('e2e_deploy_contract private initialization', () => { .constructor(...initArgs) .send() .wait(), - ).rejects.toThrow(/dropped/); + ).rejects.toThrow(/The simulated transaction is unable to be added to state and is invalid./); }); it('refuses to call a private function that requires initialization', async () => { 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 16758ffc7eaa..b6f706dd2edc 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 @@ -72,7 +72,7 @@ describe('e2e_max_block_number', () => { it('invalidates the transaction', async () => { await expect( contract.methods.set_tx_max_block_number(maxBlockNumber, enqueuePublicCall).send().wait(), - ).rejects.toThrow('dropped'); + ).rejects.toThrow('The simulated transaction is unable to be added to state and is invalid.'); }); }); @@ -88,7 +88,7 @@ describe('e2e_max_block_number', () => { it('invalidates the transaction', async () => { await expect( contract.methods.set_tx_max_block_number(maxBlockNumber, enqueuePublicCall).send().wait(), - ).rejects.toThrow('dropped'); + ).rejects.toThrow('The simulated transaction is unable to be added to state and is invalid.'); }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts b/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts index 9345caef70f0..b48ea5ceae16 100644 --- a/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts @@ -50,7 +50,7 @@ describe('e2e_voting_contract', () => { // We try voting again, but our TX is dropped due to trying to emit duplicate nullifiers as the voting contract // ignored our previous key rotation. await expect(votingContract.methods.cast_vote(candidate).send().wait()).rejects.toThrow( - 'Reason: Tx dropped by P2P node.', + 'The simulated transaction is unable to be added to state and is invalid.', ); }); }); diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index f5881b11a1d9..ac47dd3a1ba0 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -106,7 +106,11 @@ describe('full_prover', () => { sentPublicTx.wait({ timeout: 10, interval: 0.1 }), ]); - expect(String((results[0] as PromiseRejectedResult).reason)).toMatch(/Tx dropped by P2P node/); - expect(String((results[1] as PromiseRejectedResult).reason)).toMatch(/Tx dropped by P2P node/); + expect(String((results[0] as PromiseRejectedResult).reason)).toMatch( + /Error: The simulated transaction is unable to be added to state and is invalid./, + ); + expect(String((results[1] as PromiseRejectedResult).reason)).toMatch( + /Error: The simulated transaction is unable to be added to state and is invalid./, + ); }); }); diff --git a/yarn-project/end-to-end/src/fixtures/fixtures.ts b/yarn-project/end-to-end/src/fixtures/fixtures.ts index 1aa0c265a038..986bc4e417cb 100644 --- a/yarn-project/end-to-end/src/fixtures/fixtures.ts +++ b/yarn-project/end-to-end/src/fixtures/fixtures.ts @@ -7,7 +7,8 @@ export const U128_UNDERFLOW_ERROR = "Assertion failed: attempt to subtract with export const U128_OVERFLOW_ERROR = "Assertion failed: attempt to add with overflow 'hi == high'"; export const BITSIZE_TOO_BIG_ERROR = "Assertion failed. 'self.__assert_max_bit_size'"; // TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): Make these a fixed error after transition. -export const DUPLICATE_NULLIFIER_ERROR = /dropped|duplicate nullifier|reverted/; +export const DUPLICATE_NULLIFIER_ERROR = + /dropped|duplicate nullifier|reverted|The simulated transaction is unable to be added to state and is invalid./; export const NO_L1_TO_L2_MSG_ERROR = /No non-nullified L1 to L2 message found for message hash|Tried to consume nonexistent L1-to-L2 message/; export const STATIC_CALL_STATE_MODIFICATION_ERROR = diff --git a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts index bc5a5da03903..42c383196ce7 100644 --- a/yarn-project/end-to-end/src/guides/dapp_testing.test.ts +++ b/yarn-project/end-to-end/src/guides/dapp_testing.test.ts @@ -214,7 +214,9 @@ describe('guides/dapp/testing', () => { await call2.prove(); await call1.send().wait(); - await expect(call2.send().wait()).rejects.toThrow(/dropped/); + await expect(call2.send().wait()).rejects.toThrow( + /The simulated transaction is unable to be added to state and is invalid./, + ); // docs:end:tx-dropped }); diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index e099f5cc0681..87f2010e19a4 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -564,9 +564,7 @@ export class PXEService implements PXE { throw new Error(`A settled tx with equal hash ${txHash.toString()} exists.`); } - const isValidTx = await this.node.validateTx(tx); - - if (!isValidTx) { + if (!(await this.node.isValidTx(tx))) { throw new Error('The simulated transaction is unable to be added to state and is invalid.'); }