Fix validation logic by checking for 0 maker/taker amount before 0 fillTakerAssetAmount since one causes the other during combinatorial testing

This commit is contained in:
Fabio Berger
2018-07-02 10:52:49 +02:00
parent 018a437d62
commit f5a8f00af8

View File

@@ -140,12 +140,12 @@ export class OrderValidationUtils {
takerAddress: string, takerAddress: string,
zrxAssetData: string, zrxAssetData: string,
): Promise<BigNumber> { ): Promise<BigNumber> {
if (fillTakerAssetAmount.eq(0)) {
throw new Error(RevertReason.InvalidTakerAmount);
}
if (signedOrder.makerAssetAmount.eq(0) || signedOrder.takerAssetAmount.eq(0)) { if (signedOrder.makerAssetAmount.eq(0) || signedOrder.takerAssetAmount.eq(0)) {
throw new Error(RevertReason.OrderUnfillable); throw new Error(RevertReason.OrderUnfillable);
} }
if (fillTakerAssetAmount.eq(0)) {
throw new Error(RevertReason.InvalidTakerAmount);
}
const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
const isValid = await isValidSignatureAsync( const isValid = await isValidSignatureAsync(
provider, provider,