From efef5f122fdcd759c211196dd1bc6301815ecd54 Mon Sep 17 00:00:00 2001 From: Daniel Pyrathon Date: Mon, 5 Oct 2020 17:24:23 -0700 Subject: [PATCH] added fix --- packages/asset-swapper/src/types.ts | 2 +- .../src/utils/market_operation_utils/index.ts | 5 ++--- .../src/utils/market_operation_utils/multihop_utils.ts | 3 ++- .../asset-swapper/test/market_operation_utils_test.ts | 10 +++++----- packages/asset-swapper/test/quote_requestor_test.ts | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/asset-swapper/src/types.ts b/packages/asset-swapper/src/types.ts index 5b49152627..a62457c3a1 100644 --- a/packages/asset-swapper/src/types.ts +++ b/packages/asset-swapper/src/types.ts @@ -383,4 +383,4 @@ export interface SamplerOverrides { block: BlockParam; } -export type Omit = Pick>; \ No newline at end of file +export type Omit = Pick>; diff --git a/packages/asset-swapper/src/utils/market_operation_utils/index.ts b/packages/asset-swapper/src/utils/market_operation_utils/index.ts index 307b7614c0..87d973a4aa 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/index.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/index.ts @@ -1,10 +1,11 @@ import { ContractAddresses } from '@0x/contract-addresses'; +import { Web3Wrapper } from '@0x/dev-utils'; import { RFQTIndicativeQuote } from '@0x/quote-server'; import { SignedOrder } from '@0x/types'; import { BigNumber, NULL_ADDRESS } from '@0x/utils'; import * as _ from 'lodash'; -import { MarketOperation } from '../../types'; +import { MarketOperation, Omit } from '../../types'; import { QuoteRequestor } from '../quote_requestor'; import { generateQuoteReport, QuoteReport } from './../quote_report_generator'; @@ -28,7 +29,6 @@ import { import { findOptimalPathAsync } from './path_optimizer'; import { DexOrderSampler, getSampleAmounts } from './sampler'; import { SourceFilters } from './source_filters'; -import { Omit } from '../../types'; import { AggregationError, DexSample, @@ -42,7 +42,6 @@ import { OrderDomain, TokenAdjacencyGraph, } from './types'; -import { Web3Wrapper } from '@0x/dev-utils'; // tslint:disable:boolean-naming diff --git a/packages/asset-swapper/src/utils/market_operation_utils/multihop_utils.ts b/packages/asset-swapper/src/utils/market_operation_utils/multihop_utils.ts index 717d30f6f5..fc94a1626a 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/multihop_utils.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/multihop_utils.ts @@ -1,10 +1,11 @@ import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; +import { Omit } from '../../types'; + import { ZERO_AMOUNT } from './constants'; import { getTwoHopAdjustedRate } from './fills'; import { DexSample, FeeSchedule, MarketSideLiquidity, MultiHopFillData, TokenAdjacencyGraph } from './types'; -import { Omit } from '../../types'; /** * Given a token pair, returns the intermediate tokens to consider for two-hop routes. diff --git a/packages/asset-swapper/test/market_operation_utils_test.ts b/packages/asset-swapper/test/market_operation_utils_test.ts index 4fd4814acf..6db172e8e5 100644 --- a/packages/asset-swapper/test/market_operation_utils_test.ts +++ b/packages/asset-swapper/test/market_operation_utils_test.ts @@ -725,7 +725,7 @@ describe('MarketOperationUtils tests', () => { TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), - ) + ), ).callback(( _makerAssetData: string, _takerAssetData: string, @@ -763,7 +763,7 @@ describe('MarketOperationUtils tests', () => { TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), - ) + ), ).returns(async () => { return { dexQuotes: [], @@ -788,7 +788,7 @@ describe('MarketOperationUtils tests', () => { makerTokenDecimals: 6, takerTokenDecimals: 18, }; - }) + }); const result = await mockedMarketOpUtils.object.getMarketSellOrdersAsync(ORDERS, Web3Wrapper.toBaseUnitAmount(1, 18), { ...DEFAULT_OPTS, rfqt: { @@ -799,10 +799,10 @@ describe('MarketOperationUtils tests', () => { quoteRequestor: { requestRfqtFirmQuotesAsync: mockedQuoteRequestor.object.requestRfqtFirmQuotesAsync, } as any, - } + }, }); expect(result.optimizedOrders.length).to.eql(1); - expect(requestedComparisonPrice!.toString()).to.eql("0.003125"); + expect(requestedComparisonPrice!.toString()).to.eql('0.003125'); expect(result.optimizedOrders[0].makerAssetAmount.toString()).to.eql('321000000'); expect(result.optimizedOrders[0].takerAssetAmount.toString()).to.eql('1000000000000000000'); }); diff --git a/packages/asset-swapper/test/quote_requestor_test.ts b/packages/asset-swapper/test/quote_requestor_test.ts index 38460fd8ac..f9fbf02fdb 100644 --- a/packages/asset-swapper/test/quote_requestor_test.ts +++ b/packages/asset-swapper/test/quote_requestor_test.ts @@ -1,4 +1,3 @@ -import { randomAddress } from '@0x/contracts-test-utils'; import { tokenUtils } from '@0x/dev-utils'; import { assetDataUtils } from '@0x/order-utils'; import { StatusCodes } from '@0x/types';