From 2360b8282fe40e1c1b1336b17872b5699bde610e Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Thu, 10 Jan 2019 14:00:16 -0800 Subject: rename tokensAvailableInUnitAmount to tokensAvailableInBaseUnits and use test helpers --- packages/asset-buyer/src/asset_buyer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/asset-buyer/src/asset_buyer.ts') 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, }; } -- cgit