From 0eda2925bfa377abfa4e9abcf93e1348462cdf61 Mon Sep 17 00:00:00 2001 From: Xaber Date: Wed, 15 Jan 2020 14:17:17 +0800 Subject: [PATCH] fix: queryFeeFactor 0 situation --- src/utils/order.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/order.ts b/src/utils/order.ts index c360377..509b62d 100644 --- a/src/utils/order.ts +++ b/src/utils/order.ts @@ -1,5 +1,6 @@ import { MarketMakerConfig, Token, TokenConfig } from '../types' import { assetDataUtils, generatePseudoRandomSalt, orderHashUtils, signatureUtils, SignerType, SignatureType } from '0x.js' +import * as _ from 'lodash' import * as ethUtils from 'ethereumjs-util' import { toBN } from './math' import { getTokenBySymbol } from './token' @@ -89,7 +90,7 @@ const getOrderAndFeeFactor = (params: GetOrderAndFeeFactorParams) => { } const foundTokenConfig = tokenConfigs.find(t => t.symbol === takerToken.symbol) - const feeFactor = queryFeeFactor && +queryFeeFactor > 0 ? +queryFeeFactor : ( + const feeFactor = !_.isUndefined(queryFeeFactor) && !_.isNaN(+queryFeeFactor) && +queryFeeFactor >= 0 ? +queryFeeFactor : ( foundTokenConfig && foundTokenConfig.feeFactor ? foundTokenConfig.feeFactor : (config.feeFactor ? config.feeFactor : 0) )