diff --git a/src/core/lib/OrderValidator.sol b/src/core/lib/OrderValidator.sol index 18a6c66..7b69202 100644 --- a/src/core/lib/OrderValidator.sol +++ b/src/core/lib/OrderValidator.sol @@ -698,7 +698,13 @@ contract OrderValidator is Executor, ZoneInteraction { // Revert or skip if the call to generate the contract order failed. if (!success) { - return _revertOrReturnEmpty(revertOnInvalid, orderHash); + if (revertOnInvalid) { + _revertWithReasonIfOneIsReturned(); + + _revertInvalidContractOrder(orderHash); + } + + return bytes32(0); } } @@ -1019,30 +1025,6 @@ contract OrderValidator is Executor, ZoneInteraction { ); } - /** - * @dev Internal pure function to either revert or return an empty tuple - * depending on the value of `revertOnInvalid`. - * - * @param revertOnInvalid Whether to revert on invalid input. - * @param contractOrderHash The contract order hash. - * - * @return orderHash The order hash. - */ - function _revertOrReturnEmpty( - bool revertOnInvalid, - bytes32 contractOrderHash - ) - internal - pure - returns (bytes32 orderHash) - { - if (revertOnInvalid) { - _revertInvalidContractOrder(contractOrderHash); - } - - return bytes32(0); - } - /** * @dev Internal pure function to check whether a given order type indicates * that partial fills are not supported (e.g. only "full fills" are diff --git a/test/foundry/new/helpers/FuzzMutationSelectorLib.sol b/test/foundry/new/helpers/FuzzMutationSelectorLib.sol index 810250a..e063660 100644 --- a/test/foundry/new/helpers/FuzzMutationSelectorLib.sol +++ b/test/foundry/new/helpers/FuzzMutationSelectorLib.sol @@ -804,15 +804,14 @@ library FailureDetailsLib { details_withOrderHash ); - failureDetailsArray[i++] = ZoneInteractionErrors - .InvalidContractOrder + failureDetailsArray[i++] = HashCalldataContractOfferer + .HashCalldataContractOffererGenerateOrderReverts .selector .withOrder( "InvalidContractOrder_generateReverts", FuzzMutations - .mutation_invalidContractOrderGenerateReturnsInvalidEncoding - .selector, - details_withOrderHash + .mutation_invalidContractOrderGenerateReverts + .selector ); failureDetailsArray[i++] = HashCalldataContractOfferer