dagger-contracts/test/marketplace.js

21 lines
487 B
JavaScript
Raw Normal View History

const RequestState = {
New: 0,
Started: 1,
Cancelled: 2,
Finished: 3,
Failed: 4,
}
async function waitUntilExpired(expiry) {
await ethers.provider.send("hardhat_mine", [ethers.utils.hexValue(expiry)])
}
2022-09-13 07:20:07 +00:00
async function waitUntilAllSlotsFilled(contract, numSlots, requestId, proof) {
const lastSlot = numSlots - 1
for (let i = 0; i <= lastSlot; i++) {
await contract.fillSlot(requestId, i, proof)
}
}
module.exports = { waitUntilExpired, waitUntilAllSlotsFilled }