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:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user