Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit f2b261d

Browse files
committed
tests: confirm rejection of pending getLatestBlock requests when block tracker is destroyed
1 parent 3fe05d9 commit f2b261d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/PollingBlockTracker.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ describe('PollingBlockTracker', () => {
822822
});
823823
});
824824

825-
it('should reject pending latest block request if block tracker is stopped before fetch completes on second getLatestBlock call', async () => {
825+
it('should reject pending latest block request if block tracker is destroyed before fetch completes on second getLatestBlock call', async () => {
826826
const setTimeoutRecorder = recordCallsToSetTimeout();
827827
const blockTrackerOptions = {
828828
pollingInterval: 100,
@@ -873,8 +873,8 @@ describe('PollingBlockTracker', () => {
873873
// Step 3: Immediately after, call getLatestBlock
874874
const secondBlockPromise = blockTracker.getLatestBlock();
875875

876-
// Step 4: Immediately after, stop the block tracker
877-
blockTracker.removeAllListeners();
876+
// Step 4: Immediately after, destroy the block tracker
877+
await blockTracker.destroy();
878878

879879
// Verify block tracker state
880880
expect(blockTracker.isRunning()).toBe(false);

0 commit comments

Comments
 (0)