aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-02 16:52:49 +0800
committerFabio Berger <me@fabioberger.com>2018-07-02 16:52:49 +0800
commitf5a8f00af84fed0be0ab3127dc67190647baae0a (patch)
treeb9ae1d9c62527eab2ab86494e15de11c6b784ac1
parent018a437d626ea7ec41828ea387c380b03bd2287c (diff)
downloaddexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar.gz
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar.bz2
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar.lz
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar.xz
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.tar.zst
dexon-sol-tools-f5a8f00af84fed0be0ab3127dc67190647baae0a.zip
Fix validation logic by checking for 0 maker/taker amount before 0 fillTakerAssetAmount since one causes the other during combinatorial testing
-rw-r--r--packages/order-utils/src/order_validation_utils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts
index 54428f77d..94df3ef82 100644
--- a/packages/order-utils/src/order_validation_utils.ts
+++ b/packages/order-utils/src/order_validation_utils.ts
@@ -140,12 +140,12 @@ export class OrderValidationUtils {
takerAddress: string,
zrxAssetData: string,
): Promise<BigNumber> {
- if (fillTakerAssetAmount.eq(0)) {
- throw new Error(RevertReason.InvalidTakerAmount);
- }
if (signedOrder.makerAssetAmount.eq(0) || signedOrder.takerAssetAmount.eq(0)) {
throw new Error(RevertReason.OrderUnfillable);
}
+ if (fillTakerAssetAmount.eq(0)) {
+ throw new Error(RevertReason.InvalidTakerAmount);
+ }
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
const isValid = await isValidSignatureAsync(
provider,