Skip to content

Commit

Permalink
double initialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Feb 26, 2024
1 parent 33c8809 commit e2327a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions yarn-project/end-to-end/src/e2e_state_vars.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ describe('e2e_state_vars', () => {
const receipt2 = await contract.methods.match_shared_immutable(s.account, s.points).send().wait();
expect(receipt2.status).toEqual(TxStatus.MINED);
}, 200_000);

it('initializing SharedImmutable the second time should fail', async () => {
// Jest executes the tests sequentially and the first call to initialize_shared_immutable was executed
// in the previous test, so the call bellow should fail.
await expect(contract.methods.initialize_shared_immutable(1).send().wait()).rejects.toThrowError(
"Assertion failed: SharedImmutable already initialized 'fields_read[0] == 0'",
);
}, 100_000);
});

describe('PrivateMutable', () => {
Expand Down

0 comments on commit e2327a2

Please sign in to comment.