Remove mine*() testing functions
This commit is contained in:
parent
6d726fc2cc
commit
bb14732ddc
22
test/evm.js
22
test/evm.js
|
@ -14,17 +14,9 @@ async function revert() {
|
||||||
await ethers.provider.send("evm_setNextBlockTimestamp", [time + 1])
|
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) {
|
async function ensureMinimumBlockHeight(height) {
|
||||||
while ((await minedBlockNumber()) < height) {
|
while ((await ethers.provider.getBlockNumber()) < height) {
|
||||||
await mineBlock()
|
await ethers.provider.send("evm_mine")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,22 +26,20 @@ async function currentTime() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function advanceTime(seconds) {
|
async function advanceTime(seconds) {
|
||||||
ethers.provider.send("evm_increaseTime", [seconds])
|
await ethers.provider.send("evm_increaseTime", [seconds])
|
||||||
await mineBlock()
|
await ethers.provider.send("evm_mine")
|
||||||
}
|
}
|
||||||
|
|
||||||
async function advanceTimeTo(timestamp) {
|
async function advanceTimeTo(timestamp) {
|
||||||
if ((await currentTime()) !== timestamp) {
|
if ((await currentTime()) !== timestamp) {
|
||||||
ethers.provider.send("evm_setNextBlockTimestamp", [timestamp])
|
await ethers.provider.send("evm_setNextBlockTimestamp", [timestamp])
|
||||||
await mineBlock()
|
await ethers.provider.send("evm_mine")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
snapshot,
|
snapshot,
|
||||||
revert,
|
revert,
|
||||||
mineBlock,
|
|
||||||
minedBlockNumber,
|
|
||||||
ensureMinimumBlockHeight,
|
ensureMinimumBlockHeight,
|
||||||
currentTime,
|
currentTime,
|
||||||
advanceTime,
|
advanceTime,
|
||||||
|
|
Loading…
Reference in New Issue