2022-09-07 05:25:01 +00:00
|
|
|
const RequestState = {
|
|
|
|
New: 0,
|
|
|
|
Started: 1,
|
|
|
|
Cancelled: 2,
|
|
|
|
Finished: 3,
|
|
|
|
Failed: 4,
|
|
|
|
}
|
|
|
|
|
2022-08-04 02:14:36 +00:00
|
|
|
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) {
|
2022-09-21 09:13:12 +00:00
|
|
|
for (let i = 0; i < numSlots; i++) {
|
2022-09-13 07:20:07 +00:00
|
|
|
await contract.fillSlot(requestId, i, proof)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-13 07:32:02 +00:00
|
|
|
module.exports = { waitUntilExpired, waitUntilAllSlotsFilled, RequestState }
|