Convert exchange MixinWrapperFunctions to use rich reverts
This commit is contained in:
committed by
Amir Bandeali
parent
bc5c5050fb
commit
e8ecbe32ca
@@ -26,6 +26,7 @@ import "@0x/contracts-exchange-libs/contracts/src/LibFillResults.sol";
|
|||||||
import "@0x/contracts-exchange-libs/contracts/src/LibAbiEncoder.sol";
|
import "@0x/contracts-exchange-libs/contracts/src/LibAbiEncoder.sol";
|
||||||
import "./mixins/MExchangeCore.sol";
|
import "./mixins/MExchangeCore.sol";
|
||||||
import "./mixins/MWrapperFunctions.sol";
|
import "./mixins/MWrapperFunctions.sol";
|
||||||
|
import "./mixins/MExchangeRichErrors.sol";
|
||||||
|
|
||||||
|
|
||||||
contract MixinWrapperFunctions is
|
contract MixinWrapperFunctions is
|
||||||
@@ -34,7 +35,8 @@ contract MixinWrapperFunctions is
|
|||||||
LibFillResults,
|
LibFillResults,
|
||||||
LibAbiEncoder,
|
LibAbiEncoder,
|
||||||
MExchangeCore,
|
MExchangeCore,
|
||||||
MWrapperFunctions
|
MWrapperFunctions,
|
||||||
|
MExchangeRichErrors
|
||||||
{
|
{
|
||||||
/// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.
|
/// @dev Fills the input order. Reverts if exact takerAssetFillAmount not filled.
|
||||||
/// @param order Order struct containing order specifications.
|
/// @param order Order struct containing order specifications.
|
||||||
@@ -417,10 +419,9 @@ contract MixinWrapperFunctions is
|
|||||||
takerAssetFillAmount,
|
takerAssetFillAmount,
|
||||||
signature
|
signature
|
||||||
);
|
);
|
||||||
require(
|
if (fillResults.takerAssetFilledAmount != takerAssetFillAmount) {
|
||||||
fillResults.takerAssetFilledAmount == takerAssetFillAmount,
|
rrevert(IncompleteFillError(getOrderInfo(order).orderHash));
|
||||||
"COMPLETE_FILL_FAILED"
|
}
|
||||||
);
|
|
||||||
return fillResults;
|
return fillResults;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user