From f4ebbfabf48088a1b935a2fe688819be1781d1f9 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Fri, 18 May 2018 16:55:39 -0700 Subject: Added getNullFillResults --- .../current/protocol/Exchange/MixinExchangeCore.sol | 2 +- .../current/protocol/Exchange/libs/LibFillResults.sol | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'packages/contracts') diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index 4c45f06b5..1c2420374 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -107,7 +107,7 @@ contract MixinExchangeCore is ); if (status != uint8(Status.SUCCESS)) { emit ExchangeStatus(uint8(status), orderInfo.orderHash); - return fillResults; + return getNullFillResults(); } // Settle order diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/libs/LibFillResults.sol b/packages/contracts/src/contracts/current/protocol/Exchange/libs/LibFillResults.sol index ce30e3c0f..aa54598fa 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/libs/LibFillResults.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/libs/LibFillResults.sol @@ -50,4 +50,19 @@ contract LibFillResults is totalFillResults.makerFeePaid = safeAdd(totalFillResults.makerFeePaid, singleFillResults.makerFeePaid); totalFillResults.takerFeePaid = safeAdd(totalFillResults.takerFeePaid, singleFillResults.takerFeePaid); } + + /// @dev Returns a null fill results struct + function getNullFillResults() + internal + pure + returns (FillResults memory) + { + // returns zeroed out FillResults instance + return FillResults({ + makerAssetFilledAmount: 0, + takerAssetFilledAmount: 0, + makerFeePaid: 0, + takerFeePaid: 0 + }); + } } -- cgit v1.2.3