Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqiang90 committed Oct 30, 2023
1 parent 7570bd5 commit e3570a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/node-core/src/indexer/fetch.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ describe('Fetch Service', () => {

it('update the LatestBufferHeight when modulo blocks full synced', async () => {
fetchService.modulos = [20];
fetchService.finalizedHeight = 60;
fetchService.finalizedHeight = 55;

const enqueueBlocksSpy = jest.spyOn(blockDispatcher, 'enqueueBlocks');

// simulate we have synced to block 50, and modulo is 20, next block to handle suppose be 70
// we will still enqueue 60 to update LatestBufferHeight
// simulate we have synced to block 50, and modulo is 20, next block to handle suppose be 60,80,100...
// we will still enqueue 55 to update LatestBufferHeight
await fetchService.init(50);
expect(enqueueBlocksSpy).toHaveBeenCalledWith([], 60);
expect(enqueueBlocksSpy).toHaveBeenLastCalledWith([], 55);
});

it('skips bypassBlocks', async () => {
Expand Down

0 comments on commit e3570a7

Please sign in to comment.