Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Aug 8, 2024
1 parent 991a16d commit 180c9ed
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions yarn-project/end-to-end/src/e2e_block_building.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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.',
);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('e2e_voting_contract', () => {

// We try voting again, but our TX is dropped 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.',
);
});
});
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/end-to-end/src/fixtures/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/end-to-end/src/guides/dapp_testing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 180c9ed

Please sign in to comment.