aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/asset-buyer/src/errors.ts4
-rw-r--r--packages/asset-buyer/src/utils/buy_quote_calculator.ts6
-rw-r--r--packages/instant/src/util/asset.ts1
3 files changed, 3 insertions, 8 deletions
diff --git a/packages/asset-buyer/src/errors.ts b/packages/asset-buyer/src/errors.ts
index 68e9a684b..ec5fe548c 100644
--- a/packages/asset-buyer/src/errors.ts
+++ b/packages/asset-buyer/src/errors.ts
@@ -9,11 +9,11 @@ export class InsufficientAssetLiquidityError extends Error {
/**
* The amount availabe to fill (in base units) factoring in slippage.
*/
- public amountAvailableToFill?: BigNumber;
+ public amountAvailableToFill: BigNumber;
/**
* @param amountAvailableToFill The amount availabe to fill (in base units) factoring in slippage
*/
- constructor(amountAvailableToFill?: BigNumber) {
+ constructor(amountAvailableToFill: BigNumber) {
super(AssetBuyerError.InsufficientAssetLiquidity);
this.amountAvailableToFill = amountAvailableToFill;
// Setting prototype so instanceof works. See https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts
index 59293d1b7..ceeee93d3 100644
--- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts
+++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts
@@ -47,11 +47,7 @@ export const buyQuoteCalculator = {
.div(multiplerNeededWithSlippage)
.round(0, BigNumber.ROUND_DOWN);
- throw new InsufficientAssetLiquidityError(
- amountAvailableToFillConsideringSlippage.gt(constants.ZERO_AMOUNT)
- ? amountAvailableToFillConsideringSlippage
- : undefined,
- );
+ throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage);
}
// if we are not buying ZRX:
// given the orders calculated above, find the fee-orders that cover the desired assetBuyAmount (with slippage)
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts
index e7aa55c88..b009a327f 100644
--- a/packages/instant/src/util/asset.ts
+++ b/packages/instant/src/util/asset.ts
@@ -115,7 +115,6 @@ export const assetUtils = {
const assetName = assetUtils.bestNameForAsset(asset, 'of this asset');
if (
error instanceof InsufficientAssetLiquidityError &&
- error.amountAvailableToFill &&
error.amountAvailableToFill.greaterThan(BIG_NUMBER_ZERO)
) {
const unitAmountAvailableToFill = Web3Wrapper.toUnitAmount(