mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-22 12:28:51 +00:00
087c13a7fc
`fillSlot` and `freeSlot` must both be in a state of New or Started and not Cancelled (Finished to be added later). Update tests to support the above.
20 lines
468 B
JavaScript
20 lines
468 B
JavaScript
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)])
|
|
}
|
|
|
|
async function waitUntilAllSlotsFilled(contract, numSlots, requestId, proof) {
|
|
for (let i = 0; i < numSlots; i++) {
|
|
await contract.fillSlot(requestId, i, proof)
|
|
}
|
|
}
|
|
|
|
module.exports = { waitUntilExpired, waitUntilAllSlotsFilled, RequestState }
|