[marketplace] alias bytes32 types

`RequestId`, `SlotId`, `LockId`, `ProofId`, `EndId` types were created to avoid confusion and enforce compiler restrictions.
This commit is contained in:
Eric Mastro 2022-10-25 13:00:24 +11:00
parent 2478e36aba
commit e97583befd
No known key found for this signature in database
GPG Key ID: 141E3048D95A4E63
1 changed files with 9 additions and 0 deletions

View File

@ -345,6 +345,15 @@ contract Marketplace is Collateral, Proofs {
return RequestId.unwrap(a) != bytes32(b);
}
function _toProofId(SlotId slotId) internal pure returns (ProofId) {
return ProofId.wrap(SlotId.unwrap(slotId));
}
function _notEqual(RequestId a, uint256 b) internal pure returns (bool) {
return RequestId.unwrap(a) != bytes32(b);
}
struct Request {
address client;
Ask ask;