From f225f9e7c8f59a0ea04f6c9b07493a0458c4f502 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 28 Aug 2018 13:25:05 -0700 Subject: Making rounding consistent in calculateFillResults --- packages/contracts/test/exchange/internal.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'packages/contracts/test/exchange') diff --git a/packages/contracts/test/exchange/internal.ts b/packages/contracts/test/exchange/internal.ts index c5d2fc58f..dc2c5fbe0 100644 --- a/packages/contracts/test/exchange/internal.ts +++ b/packages/contracts/test/exchange/internal.ts @@ -221,16 +221,19 @@ describe('Exchange core internal functions', () => { // in any mathematical operation in either the reference TypeScript // implementation or the Solidity implementation of // calculateFillResults. + const makerAssetFilledAmount = await referenceSafeGetPartialAmountFloorAsync( + takerAssetFilledAmount, + orderTakerAssetAmount, + otherAmount, + ); + const order = makeOrder(otherAmount, orderTakerAssetAmount, otherAmount, otherAmount); + const orderMakerAssetAmount = order.makerAssetAmount; return { - makerAssetFilledAmount: await referenceSafeGetPartialAmountFloorAsync( - takerAssetFilledAmount, - orderTakerAssetAmount, - otherAmount, - ), + makerAssetFilledAmount, takerAssetFilledAmount, makerFeePaid: await referenceSafeGetPartialAmountFloorAsync( - takerAssetFilledAmount, - orderTakerAssetAmount, + makerAssetFilledAmount, + orderMakerAssetAmount, otherAmount, ), takerFeePaid: await referenceSafeGetPartialAmountFloorAsync( -- cgit v1.2.3