From bb14732ddc4a89c31d8fa738ab84205bb53f7d6d Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 9 Mar 2022 11:29:41 +0100 Subject: [PATCH] Remove mine*() testing functions --- test/evm.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/test/evm.js b/test/evm.js index 5de5deb..c034ec2 100644 --- a/test/evm.js +++ b/test/evm.js @@ -14,17 +14,9 @@ async function revert() { await ethers.provider.send("evm_setNextBlockTimestamp", [time + 1]) } -async function mineBlock() { - await ethers.provider.send("evm_mine") -} - -async function minedBlockNumber() { - return await ethers.provider.getBlockNumber() -} - async function ensureMinimumBlockHeight(height) { - while ((await minedBlockNumber()) < height) { - await mineBlock() + while ((await ethers.provider.getBlockNumber()) < height) { + await ethers.provider.send("evm_mine") } } @@ -34,22 +26,20 @@ async function currentTime() { } async function advanceTime(seconds) { - ethers.provider.send("evm_increaseTime", [seconds]) - await mineBlock() + await ethers.provider.send("evm_increaseTime", [seconds]) + await ethers.provider.send("evm_mine") } async function advanceTimeTo(timestamp) { if ((await currentTime()) !== timestamp) { - ethers.provider.send("evm_setNextBlockTimestamp", [timestamp]) - await mineBlock() + await ethers.provider.send("evm_setNextBlockTimestamp", [timestamp]) + await ethers.provider.send("evm_mine") } } module.exports = { snapshot, revert, - mineBlock, - minedBlockNumber, ensureMinimumBlockHeight, currentTime, advanceTime,