From 3b55fbd064fcf7f0e2569c5c93d5b8532b1cca00 Mon Sep 17 00:00:00 2001 From: Simson Date: Tue, 12 Sep 2023 17:30:20 +0530 Subject: [PATCH] Coverage issue fix (#10598) --- contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts | 3 +-- contracts/test/v0.8/dev/OptimismValidator.test.ts | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts b/contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts index e6b44041a71..2856568793a 100644 --- a/contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts +++ b/contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts @@ -108,8 +108,7 @@ describe('OptimismSequencerUptimeFeed', () => { .updateStatus(true, timestamp.add(200)) // Submit another status update with the same status - const currentBlock = await ethers.provider.getBlockNumber() - const latestBlock = await ethers.provider.getBlock(currentBlock) + const latestBlock = await ethers.provider.getBlock('latest') await expect(tx) .to.emit(optimismUptimeFeed, 'RoundUpdated') diff --git a/contracts/test/v0.8/dev/OptimismValidator.test.ts b/contracts/test/v0.8/dev/OptimismValidator.test.ts index a63780a3f3e..120b1057d14 100644 --- a/contracts/test/v0.8/dev/OptimismValidator.test.ts +++ b/contracts/test/v0.8/dev/OptimismValidator.test.ts @@ -75,8 +75,7 @@ describe('OptimismValidator', () => { it('posts sequencer status when there is not status change', async () => { await optimismValidator.addAccess(eoaValidator.address) - const currentBlockNum = await ethers.provider.getBlockNumber() - const currentBlock = await ethers.provider.getBlock(currentBlockNum) + const currentBlock = await ethers.provider.getBlock('latest') const futureTimestamp = currentBlock.timestamp + 5000 await ethers.provider.send('evm_setNextBlockTimestamp', [futureTimestamp]) @@ -100,8 +99,7 @@ describe('OptimismValidator', () => { it('post sequencer offline', async () => { await optimismValidator.addAccess(eoaValidator.address) - const currentBlockNum = await ethers.provider.getBlockNumber() - const currentBlock = await ethers.provider.getBlock(currentBlockNum) + const currentBlock = await ethers.provider.getBlock('latest') const futureTimestamp = currentBlock.timestamp + 10000 await ethers.provider.send('evm_setNextBlockTimestamp', [futureTimestamp])