aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/utils
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2017-11-20 06:04:26 +0800
committerJacob Evans <jacob@dekz.net>2017-11-20 06:04:26 +0800
commit3bb6d8871b459c4f3975b600d391558188aa48b7 (patch)
treeca2f9757e2c508c9fee360631b1b7741dd048bee /packages/0x.js/src/utils
parentcf7727debc5ae030795a876a316668e83891cdbf (diff)
downloaddexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar.gz
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar.bz2
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar.lz
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar.xz
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.tar.zst
dexon-sol-tools-3bb6d8871b459c4f3975b600d391558188aa48b7.zip
Readability variable names
Diffstat (limited to 'packages/0x.js/src/utils')
-rw-r--r--packages/0x.js/src/utils/order_state_utils.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts
index 4c1bef64e..4d8f90f62 100644
--- a/packages/0x.js/src/utils/order_state_utils.ts
+++ b/packages/0x.js/src/utils/order_state_utils.ts
@@ -85,7 +85,7 @@ export class OrderStateUtils {
let remainingFillableMakerTokenAmount;
if (signedOrder.makerFee.isZero() ||
- (transferrableFeeTokenAmount.greaterThanOrEqualTo(signedOrder.makerFee) &&
+ (transferrableFeeTokenAmount.greaterThanOrEqualTo(remainingFeeTokenAmount) &&
transferrableMakerTokenAmount.greaterThanOrEqualTo(remainingMakerTokenAmount) &&
signedOrder.makerTokenAddress !== zrxTokenAddress)) {
remainingFillableMakerTokenAmount = transferrableMakerTokenAmount;
@@ -111,17 +111,17 @@ export class OrderStateUtils {
};
return orderRelevantState;
}
- private calculatePartiallyFillableMakerTokenAmount(makerTransferrable: BigNumber, makerFeeTransferrable: BigNumber,
- remainingMakerAmount: BigNumber, remainingMakerFee: BigNumber,
- totalMakerAmount: BigNumber, makerFee: BigNumber,
+ private calculatePartiallyFillableMakerTokenAmount(makerTransferrableAmount: BigNumber, makerFeeTransferrableAmount: BigNumber,
+ remainingMakerAmount: BigNumber, remainingMakerFeeAmount: BigNumber,
+ totalMakerAmount: BigNumber, makerFeeAmount: BigNumber,
makerTokenAddress: string, zrxTokenAddress: string): BigNumber {
- const orderToFeeRatio = totalMakerAmount.dividedToIntegerBy(makerFee);
- let fillableTimesInMakerToken = makerTransferrable.dividedToIntegerBy(orderToFeeRatio);
- const fillableTimesInFeeToken = BigNumber.min(makerFeeTransferrable, remainingMakerFee);
+ const orderToFeeRatio = totalMakerAmount.dividedToIntegerBy(makerFeeAmount);
+ const fillableTimesInFeeToken = BigNumber.min(makerFeeTransferrableAmount, remainingMakerFeeAmount);
+ let fillableTimesInMakerToken = makerTransferrableAmount.dividedToIntegerBy(orderToFeeRatio);
if (makerTokenAddress === zrxTokenAddress) {
- fillableTimesInMakerToken = makerTransferrable.plus(makerFeeTransferrable)
- .dividedToIntegerBy(orderToFeeRatio.plus(
- ZeroEx.toBaseUnitAmount(new BigNumber(1), 18)));
+ const totalFeeTokenPool = makerTransferrableAmount.plus(makerFeeTransferrableAmount);
+ fillableTimesInMakerToken = totalFeeTokenPool.dividedToIntegerBy(
+ orderToFeeRatio.plus(ZeroEx.toBaseUnitAmount(new BigNumber(1), 18)));
}
return BigNumber.min(fillableTimesInMakerToken.times(orderToFeeRatio),