aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-05-19 07:55:39 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-05-19 08:07:00 +0800
commitf4ebbfabf48088a1b935a2fe688819be1781d1f9 (patch)
tree5a9d8e7d118f79f3cb7fe238d5a9b447891f78d7 /packages/contracts
parentb5bcfc8fe7680b094091823483d2416a73da9be9 (diff)
downloaddexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar.gz
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar.bz2
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar.lz
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar.xz
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.tar.zst
dexon-sol-tools-f4ebbfabf48088a1b935a2fe688819be1781d1f9.zip
Added getNullFillResults
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol2
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/libs/LibFillResults.sol15
2 files changed, 16 insertions, 1 deletions
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
+ });
+ }
}