From 3d5b229c466f12b26564245e525b58d0a38de16a Mon Sep 17 00:00:00 2001 From: David Sun Date: Sat, 23 Nov 2019 20:22:28 -0500 Subject: [PATCH] prettier --- .../exchange_swap_quote_consumer.ts | 17 ++------ .../forwarder_swap_quote_consumer.ts | 6 +-- .../test/exchange_swap_quote_consumer_test.ts | 16 ++------ .../forwarder_swap_quote_consumer_test.ts | 6 +-- .../test/order_prune_utils_test.ts | 41 ++++++------------- 5 files changed, 23 insertions(+), 63 deletions(-) diff --git a/packages/asset-swapper/src/quote_consumers/exchange_swap_quote_consumer.ts b/packages/asset-swapper/src/quote_consumers/exchange_swap_quote_consumer.ts index 25008e1c32..f0a47f3ad1 100644 --- a/packages/asset-swapper/src/quote_consumers/exchange_swap_quote_consumer.ts +++ b/packages/asset-swapper/src/quote_consumers/exchange_swap_quote_consumer.ts @@ -140,13 +140,8 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase o.signature), - ) - .sendTransactionAsync( - { + .marketBuyOrdersFillOrKill(orders, makerAssetFillAmount, orders.map(o => o.signature)) + .sendTransactionAsync({ from: finalTakerAddress, gas: gasLimit, gasPrice, @@ -155,12 +150,8 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase o.signature), - ).sendTransactionAsync( - { + .marketSellOrdersFillOrKill(orders, takerAssetFillAmount, orders.map(o => o.signature)) + .sendTransactionAsync({ from: finalTakerAddress, gas: gasLimit, gasPrice, 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 2771e35ec3..92b2159088 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 @@ -196,8 +196,7 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase o.signature), formattedFeePercentage, feeRecipient) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: finalTakerAddress, gas: gasLimit, gasPrice, diff --git a/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts b/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts index 5bb1fcd6e0..c3c7db1fb6 100644 --- a/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts +++ b/packages/asset-swapper/test/exchange_swap_quote_consumer_test.ts @@ -183,24 +183,20 @@ describe('ExchangeSwapQuoteConsumer', () => { await erc20MakerTokenContract .transfer(makerAddress, marketBuySwapQuote.worstCaseQuoteInfo.makerAssetAmount) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: coinbaseAddress, }); await erc20TakerTokenContract .transfer(takerAddress, marketBuySwapQuote.worstCaseQuoteInfo.totalTakerAssetAmount) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: coinbaseAddress, }); await erc20MakerTokenContract .approve(contractAddresses.erc20Proxy, UNLIMITED_ALLOWANCE) - .sendTransactionAsync( - { from: makerAddress }); + .sendTransactionAsync({ from: makerAddress }); await erc20TakerTokenContract .approve(contractAddresses.erc20Proxy, UNLIMITED_ALLOWANCE) - .sendTransactionAsync( - { from: takerAddress }); + .sendTransactionAsync({ from: takerAddress }); }); afterEach(async () => { await blockchainLifecycle.revertAsync(); @@ -211,12 +207,10 @@ describe('ExchangeSwapQuoteConsumer', () => { * Does not test the validity of the state change performed by the forwarder smart contract */ it('should perform a marketSell execution when provided a MarketSell type swapQuote', async () => { - console.log('herello?'); await expectMakerAndTakerBalancesForMakerAssetAsync( new BigNumber(10).multipliedBy(ONE_ETH_IN_WEI), constants.ZERO_AMOUNT, ); - console.log('he?'); await expectMakerAndTakerBalancesForTakerAssetAsync( constants.ZERO_AMOUNT, new BigNumber(10).multipliedBy(ONE_ETH_IN_WEI), @@ -225,12 +219,10 @@ describe('ExchangeSwapQuoteConsumer', () => { takerAddress, gasLimit: 4000000, }); - console.log('herelloas?'); await expectMakerAndTakerBalancesForMakerAssetAsync( constants.ZERO_AMOUNT, new BigNumber(10).multipliedBy(ONE_ETH_IN_WEI), ); - console.log('haserello?'); await expectMakerAndTakerBalancesForTakerAssetAsync( new BigNumber(10).multipliedBy(ONE_ETH_IN_WEI), constants.ZERO_AMOUNT, diff --git a/packages/asset-swapper/test/forwarder_swap_quote_consumer_test.ts b/packages/asset-swapper/test/forwarder_swap_quote_consumer_test.ts index c9669d5675..65320602b5 100644 --- a/packages/asset-swapper/test/forwarder_swap_quote_consumer_test.ts +++ b/packages/asset-swapper/test/forwarder_swap_quote_consumer_test.ts @@ -154,11 +154,7 @@ describe('ForwarderSwapQuoteConsumer', () => { const totalFillableAmount = new BigNumber(10).multipliedBy(ONE_ETH_IN_WEI); - await erc20TokenContract.transfer( - makerAddress, - totalFillableAmount, - ).sendTransactionAsync( - { + await erc20TokenContract.transfer(makerAddress, totalFillableAmount).sendTransactionAsync({ from: coinbaseAddress, }); diff --git a/packages/asset-swapper/test/order_prune_utils_test.ts b/packages/asset-swapper/test/order_prune_utils_test.ts index ec798a909d..5d187796ba 100644 --- a/packages/asset-swapper/test/order_prune_utils_test.ts +++ b/packages/asset-swapper/test/order_prune_utils_test.ts @@ -123,31 +123,20 @@ describe('OrderPruner', () => { // give double fillableAmount to maker and taker as buffer await erc20MakerTokenContract - .transfer( - makerAddress, - fillableAmount.multipliedBy(4), - ) - .sendTransactionAsync( - { from: coinbaseAddress }); + .transfer(makerAddress, fillableAmount.multipliedBy(4)) + .sendTransactionAsync({ from: coinbaseAddress }); await erc20TakerTokenContract - .transfer( - takerAddress, - fillableAmount.multipliedBy(4), - ) - .sendTransactionAsync( - { from: coinbaseAddress }); + .transfer(takerAddress, fillableAmount.multipliedBy(4)) + .sendTransactionAsync({ from: coinbaseAddress }); await erc20MakerTokenContract .approve(contractAddresses.erc20Proxy, UNLIMITED_ALLOWANCE_IN_BASE_UNITS) - .sendTransactionAsync( - { from: makerAddress }); + .sendTransactionAsync({ from: makerAddress }); await erc20MakerTokenContract .approve(contractAddresses.erc20Proxy, UNLIMITED_ALLOWANCE_IN_BASE_UNITS) - .sendTransactionAsync( - { from: takerAddress }); + .sendTransactionAsync({ from: takerAddress }); await erc20TakerTokenContract .approve(contractAddresses.erc20Proxy, UNLIMITED_ALLOWANCE_IN_BASE_UNITS) - .sendTransactionAsync( - { from: takerAddress }); + .sendTransactionAsync({ from: takerAddress }); partiallyFilledOpenSignedOrderFeeless = await orderFactory.newSignedOrderAsync({ takerAssetAmount: fillableAmount, @@ -160,8 +149,7 @@ describe('OrderPruner', () => { partialFillAmount, partiallyFilledOpenSignedOrderFeeless.signature, ) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: takerAddress, gasPrice: GAS_PRICE, gas: 4000000, @@ -181,8 +169,7 @@ describe('OrderPruner', () => { partialFillAmount, partiallyFilledOpenSignedOrderFeeInTakerAsset.signature, ) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: takerAddress, gasPrice: GAS_PRICE, gas: 4000000, @@ -202,8 +189,7 @@ describe('OrderPruner', () => { partialFillAmount, partiallyFilledOpenSignedOrderFeeInMakerAsset.signature, ) - .sendTransactionAsync( - { + .sendTransactionAsync({ from: takerAddress, gasPrice: GAS_PRICE, gas: 4000000, @@ -216,11 +202,8 @@ describe('OrderPruner', () => { }); await exchangeContract - .fillOrKillOrder( - filledOpenSignedOrder, fillableAmount, filledOpenSignedOrder.signature, - ) - .sendTransactionAsync( - { + .fillOrKillOrder(filledOpenSignedOrder, fillableAmount, filledOpenSignedOrder.signature) + .sendTransactionAsync({ from: takerAddress, gasPrice: GAS_PRICE, gas: 4000000,