[marketplace] Move RequestState enum to Requests.sol

This commit is contained in:
Mark Spanbroek 2023-01-16 14:21:58 +01:00 committed by markspanbroek
parent bb0302afcb
commit 10f88a62a7
2 changed files with 8 additions and 8 deletions

View File

@ -365,14 +365,6 @@ contract Marketplace is Collateral, Proofs, StateRetrieval {
return s == RequestState.New || s == RequestState.Started;
}
enum RequestState {
New, // [default] waiting to fill slots
Started, // all slots filled, accepting regular proofs
Cancelled, // not enough slots filled before expiry
Finished, // successfully completed
Failed // too many nodes have failed to provide proofs, data lost
}
struct RequestContext {
uint256 slotsFilled;
RequestState state;

View File

@ -37,6 +37,14 @@ struct PoR {
bytes name; // random name
}
enum RequestState {
New, // [default] waiting to fill slots
Started, // all slots filled, accepting regular proofs
Cancelled, // not enough slots filled before expiry
Finished, // successfully completed
Failed // too many nodes have failed to provide proofs, data lost
}
library Requests {
function id(Request memory request) internal pure returns (RequestId) {
return RequestId.wrap(keccak256(abi.encode(request)));