aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/asset_buyer.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-11 06:00:16 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-11 06:00:16 +0800
commit2360b8282fe40e1c1b1336b17872b5699bde610e (patch)
treeb5965d3ef0fe24645e7e9beaae71e71d2999f8b4 /packages/asset-buyer/src/asset_buyer.ts
parent0dade8624c0935a26bed9b9c53a94a8211dabdee (diff)
downloaddexon-0x-contracts-2360b8282fe40e1c1b1336b17872b5699bde610e.tar.gz
dexon-0x-contracts-2360b8282fe40e1c1b1336b17872b5699bde610e.tar.zst
dexon-0x-contracts-2360b8282fe40e1c1b1336b17872b5699bde610e.zip
rename tokensAvailableInUnitAmount to tokensAvailableInBaseUnits and use test helpers
Diffstat (limited to 'packages/asset-buyer/src/asset_buyer.ts')
-rw-r--r--packages/asset-buyer/src/asset_buyer.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/asset-buyer/src/asset_buyer.ts b/packages/asset-buyer/src/asset_buyer.ts
index 511c99fb1..92a99c28c 100644
--- a/packages/asset-buyer/src/asset_buyer.ts
+++ b/packages/asset-buyer/src/asset_buyer.ts
@@ -45,19 +45,19 @@ const calculateLiquidity = (ordersAndFillableAmounts: OrdersAndFillableAmounts):
const tokensAvailableForCurrentOrder = availableMakerAssetAmount;
const ethValueAvailableForCurrentOrder = orderUtils.getTakerFillAmount(order, availableMakerAssetAmount);
return {
- tokensAvailableInUnitAmount: acc.tokensAvailableInUnitAmount.plus(tokensAvailableForCurrentOrder),
+ tokensAvailableInBaseUnits: acc.tokensAvailableInBaseUnits.plus(tokensAvailableForCurrentOrder),
ethValueAvailableInWei: acc.ethValueAvailableInWei.plus(ethValueAvailableForCurrentOrder),
};
},
{
- tokensAvailableInUnitAmount: new BigNumber(0),
+ tokensAvailableInBaseUnits: new BigNumber(0),
ethValueAvailableInWei: new BigNumber(0),
},
);
// Turn into regular numbers
return {
- tokensAvailableInUnitAmount: liquidityInBigNumbers.tokensAvailableInUnitAmount.toNumber(),
+ tokensAvailableInBaseUnits: liquidityInBigNumbers.tokensAvailableInBaseUnits.toNumber(),
ethValueAvailableInWei: liquidityInBigNumbers.ethValueAvailableInWei.toNumber(),
};
};
@@ -225,7 +225,7 @@ export class AssetBuyer {
const assetPairs = await this.orderProvider.getAvailableMakerAssetDatasAsync(assetData);
if (!assetPairs.includes(assetData)) {
return {
- tokensAvailableInUnitAmount: 0,
+ tokensAvailableInBaseUnits: 0,
ethValueAvailableInWei: 0,
};
}