diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-18 20:06:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 20:06:08 +0800 |
commit | 3973dec9944a10c62ec6c3d15d973a00a6ea45a6 (patch) | |
tree | 73f1528a36b8fc8a0778e164b1579eb5865d944a /packages/order-utils/src/order_state_utils.ts | |
parent | bef30e4209b26c8d4f443f8672e9acb9471c6a37 (diff) | |
parent | c8212f1d4d255120e5e683664b86f1830fb45ae6 (diff) | |
download | dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar.gz dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar.bz2 dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar.lz dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar.xz dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.tar.zst dexon-sol-tools-3973dec9944a10c62ec6c3d15d973a00a6ea45a6.zip |
Merge pull request #1517 from 0xProject/feature/bignumber-8.0
Bignumber 8.0
Diffstat (limited to 'packages/order-utils/src/order_state_utils.ts')
-rw-r--r-- | packages/order-utils/src/order_state_utils.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 389419587..430178b5d 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -214,10 +214,10 @@ export class OrderStateUtils { const remainingFillableTakerAssetAmountGivenTakersStatus = orderRelevantTakerState.remainingFillableAssetAmount; // The min of these two in the actualy max fillable by either party - const fillableTakerAssetAmount = BigNumber.min([ + const fillableTakerAssetAmount = BigNumber.min( remainingFillableTakerAssetAmountGivenMakersStatus, remainingFillableTakerAssetAmountGivenTakersStatus, - ]); + ); return fillableTakerAssetAmount; } @@ -260,8 +260,8 @@ export class OrderStateUtils { traderAddress, ); - const transferrableTraderAssetAmount = BigNumber.min([traderProxyAllowance, traderBalance]); - const transferrableFeeAssetAmount = BigNumber.min([traderFeeProxyAllowance, traderFeeBalance]); + const transferrableTraderAssetAmount = BigNumber.min(traderProxyAllowance, traderBalance); + const transferrableFeeAssetAmount = BigNumber.min(traderFeeProxyAllowance, traderFeeBalance); const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const filledTakerAssetAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash); @@ -312,7 +312,7 @@ export class OrderStateUtils { const tokenAddress = decodedAssetData.tokenAddress; balances[tokenAddress] = _.isUndefined(initialBalances[tokenAddress]) ? balance - : balances[tokenAddress].add(balance); + : balances[tokenAddress].plus(balance); } else if (assetDataUtils.isMultiAssetData(decodedAssetData)) { for (const assetDataElement of decodedAssetData.nestedAssetData) { balances = await this._getAssetBalancesAsync(assetDataElement, traderAddress, balances); @@ -335,7 +335,7 @@ export class OrderStateUtils { const tokenAddress = decodedAssetData.tokenAddress; allowances[tokenAddress] = _.isUndefined(initialAllowances[tokenAddress]) ? allowance - : allowances[tokenAddress].add(allowance); + : allowances[tokenAddress].plus(allowance); } else if (assetDataUtils.isMultiAssetData(decodedAssetData)) { for (const assetDataElement of decodedAssetData.nestedAssetData) { allowances = await this._getAssetBalancesAsync(assetDataElement, traderAddress, allowances); |