From e97583befdf8e3e03263cc7d05e14d75aa9ea948 Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Tue, 25 Oct 2022 13:00:24 +1100 Subject: [PATCH] [marketplace] alias bytes32 types `RequestId`, `SlotId`, `LockId`, `ProofId`, `EndId` types were created to avoid confusion and enforce compiler restrictions. --- contracts/Marketplace.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contracts/Marketplace.sol b/contracts/Marketplace.sol index ce27027..95adb59 100644 --- a/contracts/Marketplace.sol +++ b/contracts/Marketplace.sol @@ -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;