diff options
author | Greg Hysen <hysz@users.noreply.github.com> | 2018-08-29 04:51:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 04:51:38 +0800 |
commit | 1402a0aa22a071eca75a2b263f516d209f74bafc (patch) | |
tree | ed994e001182e7109723af7c94ec99b6ff20bca8 /packages/contracts/test/exchange/internal.ts | |
parent | 14fdb71a716cb95bc1f6933db9057d23f3c41909 (diff) | |
parent | f225f9e7c8f59a0ea04f6c9b07493a0458c4f502 (diff) | |
download | dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar.gz dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar.bz2 dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar.lz dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar.xz dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.tar.zst dexon-sol-tools-1402a0aa22a071eca75a2b263f516d209f74bafc.zip |
Merge pull request #1036 from 0xProject/fix/contracts/calculateFillResults
Making rounding consistent in calculateFillResults
Diffstat (limited to 'packages/contracts/test/exchange/internal.ts')
-rw-r--r-- | packages/contracts/test/exchange/internal.ts | 17 |
1 files changed, 10 insertions, 7 deletions
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( |