From fdef608bb29c95e91fda740dc7e82eeceb15a230 Mon Sep 17 00:00:00 2001 From: sklppy88 Date: Thu, 8 Aug 2024 16:00:10 +0000 Subject: [PATCH] init --- yarn-project/end-to-end/src/e2e_block_building.test.ts | 8 ++++++-- .../end-to-end/src/e2e_deploy_contract/legacy.test.ts | 4 +++- .../e2e_deploy_contract/private_initialization.test.ts | 2 +- .../end-to-end/src/e2e_private_voting_contract.test.ts | 4 ++-- yarn-project/end-to-end/src/e2e_prover/full.test.ts | 8 ++++++-- yarn-project/end-to-end/src/fixtures/fixtures.ts | 3 ++- yarn-project/end-to-end/src/guides/dapp_testing.test.ts | 4 +++- 7 files changed, 23 insertions(+), 10 deletions(-) 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 d88811cdb8de..13cc1fa6d1aa 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 @@ -208,7 +208,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 () => { @@ -230,7 +232,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 8ed9c00c642d..c37036cb8a66 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 @@ -94,7 +94,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_private_voting_contract.test.ts b/yarn-project/end-to-end/src/e2e_private_voting_contract.test.ts index 9b8ee38bcda2..0546f6d41b45 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 @@ -53,9 +53,9 @@ describe('e2e_voting_contract', () => { }), ).rejects.toThrow('The simulated transaction is unable to be added to state and is invalid.'); - // We try voting again, but our TX is dropped due to trying to emit duplicate nullifiers + // We try voting again, but our TX is invalid due to trying to emit duplicate nullifiers 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 485c6d3d8479..5fea29f65634 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 @@ -105,7 +105,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 25e9922b5cb8..642c876952be 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 = "'self.__assert_max_bit_size(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 ce9065c8147a..e229665a7266 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 @@ -237,7 +237,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 });