Skip to content

Commit 8f9156a

Browse files
committed
GetLastBlock number in test
1 parent 6688b75 commit 8f9156a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/SFC.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,10 @@ describe('SFC', () => {
418418
const epochNumber = await this.sfc.currentEpoch();
419419
await this.sfc.enableNonNodeCalls();
420420
await this.sfc.sealEpoch([100, 101, 102], [100, 101, 102], [100, 101, 102], [100, 101, 102], 0);
421-
const lastBlock = await ethers.provider.getBlock('latest');
422-
expect(lastBlock).to.not.equal(null);
421+
const lastBlock = await ethers.provider.getBlockNumber()
423422
// endBlock is on second position
424-
expect((await this.sfc.getEpochSnapshot(epochNumber))[1]).to.equal(lastBlock!.number);
425-
expect(await this.sfc.getEpochEndBlock(epochNumber)).to.equal(lastBlock!.number);
423+
expect((await this.sfc.getEpochSnapshot(epochNumber))[1]).to.equal(lastBlock);
424+
expect(await this.sfc.getEpochEndBlock(epochNumber)).to.equal(lastBlock);
426425
});
427426
});
428427
});

0 commit comments

Comments
 (0)