Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions yarn-project/validator-client/src/checkpoint_builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ describe('CheckpointBuilder', () => {

it('uses the same contractsDB across multiple block builds', async () => {
await mockSuccessfulBlock();
await checkpointBuilder.buildBlock([], blockNumber, 1000n);
await checkpointBuilder.buildBlock([], blockNumber, 1000n, validatorOpts());

await mockSuccessfulBlock();
await checkpointBuilder.buildBlock([], BlockNumber(blockNumber + 1), 1001n);
await checkpointBuilder.buildBlock([], BlockNumber(blockNumber + 1), 1001n, validatorOpts());

expect(createCheckpointSpy).toHaveBeenCalledTimes(2);
expect(commitCheckpointSpy).toHaveBeenCalledTimes(2);
Expand All @@ -184,7 +184,9 @@ describe('CheckpointBuilder', () => {
it('calls revertCheckpoint when public processor fails', async () => {
processor.process.mockRejectedValue(new Error('processor failure'));

await expect(checkpointBuilder.buildBlock([], blockNumber, 1000n)).rejects.toThrow('processor failure');
await expect(checkpointBuilder.buildBlock([], blockNumber, 1000n, validatorOpts())).rejects.toThrow(
'processor failure',
);

expect(createCheckpointSpy).toHaveBeenCalledTimes(1);
expect(commitCheckpointSpy).not.toHaveBeenCalled();
Expand Down
Loading