From 77bdb90bbaa1b14db592505f08b9470984ab7633 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Tue, 31 Mar 2020 04:20:34 +1000 Subject: [PATCH] [asset-swapper] Forwarder throws on market sell if amount not sold (#2534) --- .../quote_consumers/forwarder_swap_quote_consumer.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/asset-swapper/src/quote_consumers/forwarder_swap_quote_consumer.ts b/packages/asset-swapper/src/quote_consumers/forwarder_swap_quote_consumer.ts index dce4e9c982..6284fcd2d9 100644 --- a/packages/asset-swapper/src/quote_consumers/forwarder_swap_quote_consumer.ts +++ b/packages/asset-swapper/src/quote_consumers/forwarder_swap_quote_consumer.ts @@ -76,7 +76,13 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase { .getABIEncodedTransactionData(); } else { calldataHexString = this._forwarder - .marketSellOrdersWithEth(orders, signatures, [feeAmount], [normalizedFeeRecipientAddress]) + .marketSellAmountWithEth( + orders, + quote.takerAssetFillAmount, + signatures, + [feeAmount], + [normalizedFeeRecipientAddress], + ) .getABIEncodedTransactionData(); } @@ -139,7 +145,7 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase { }); } else { txHash = await this._forwarder - .marketSellOrdersWithEth(orders, signatures, [feeAmount], [feeRecipient]) + .marketSellAmountWithEth(orders, quote.takerAssetFillAmount, signatures, [feeAmount], [feeRecipient]) .sendTransactionAsync({ from: finalTakerAddress, gas: gasLimit,