From 1a1a7774faf7397d7d6fcbed5be65225afe59f71 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Sun, 7 Jun 2020 21:30:24 -0400 Subject: [PATCH] `@0x/asset-swapper`: Address review feedback --- .../quote_consumers/exchange_proxy_swap_quote_consumer.ts | 7 ++++++- packages/contract-wrappers/CHANGELOG.json | 2 +- packages/migrations/CHANGELOG.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts b/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts index 2f97512505..4c55dada7e 100644 --- a/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts +++ b/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts @@ -125,9 +125,14 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase { ) .getABIEncodedTransactionData(); + let ethAmount = quote.worstCaseQuoteInfo.protocolFeeInWeiAmount; + if (exchangeProxyOpts.isFromETH) { + ethAmount = ethAmount.plus(quote.worstCaseQuoteInfo.takerAssetAmount); + } + return { calldataHexString, - ethAmount: quote.worstCaseQuoteInfo.protocolFeeInWeiAmount, + ethAmount, toAddress: this._transformFeature.address, allowanceTarget: this.contractAddresses.exchangeProxyAllowanceTarget, }; diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index d8265bce81..54dfeca49a 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -32,7 +32,7 @@ }, { "note": "Add `ITransformERC20`", - "pr": "TODO" + "pr": 2591 } ] }, diff --git a/packages/migrations/CHANGELOG.json b/packages/migrations/CHANGELOG.json index 64562579ca..6329d462b5 100644 --- a/packages/migrations/CHANGELOG.json +++ b/packages/migrations/CHANGELOG.json @@ -11,7 +11,7 @@ "pr": 2541 }, { - "note": "Return emtpy Exchange Proxy addresses", + "note": "Return empty Exchange Proxy addresses", "pr": 2591 } ]