mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-16 17:45:40 +00:00
Extract mining test helpers to separate module
This commit is contained in:
parent
6de82709ca
commit
d0a22afc3d
@ -1,5 +1,6 @@
|
||||
const { expect } = require("chai")
|
||||
const { ethers } = require("hardhat")
|
||||
const { mineBlock, minedBlockNumber } = require ("./mining")
|
||||
|
||||
describe("Proofs", function () {
|
||||
|
||||
@ -15,14 +16,6 @@ describe("Proofs", function () {
|
||||
proofs = await Proofs.deploy()
|
||||
})
|
||||
|
||||
async function mineBlock() {
|
||||
await ethers.provider.send("evm_mine")
|
||||
}
|
||||
|
||||
async function minedBlockNumber() {
|
||||
return await ethers.provider.getBlockNumber()
|
||||
}
|
||||
|
||||
it("indicates that proofs are required", async function() {
|
||||
await proofs.expectProofs(id, period, timeout, duration)
|
||||
expect(await proofs.period(id)).to.equal(period)
|
||||
|
11
test/mining.js
Normal file
11
test/mining.js
Normal file
@ -0,0 +1,11 @@
|
||||
const { ethers } = require("hardhat")
|
||||
|
||||
async function mineBlock() {
|
||||
await ethers.provider.send("evm_mine")
|
||||
}
|
||||
|
||||
async function minedBlockNumber() {
|
||||
return await ethers.provider.getBlockNumber()
|
||||
}
|
||||
|
||||
module.exports = { mineBlock, minedBlockNumber }
|
Loading…
x
Reference in New Issue
Block a user