From ef65aa5bf69ba4c829712502a5f494d16bd492d3 Mon Sep 17 00:00:00 2001 From: Alex Kroeger Date: Wed, 14 Oct 2020 11:37:03 -0700 Subject: [PATCH] further fixes in market operation utils --- .../src/utils/market_operation_utils/cream_utils.ts | 4 ++-- .../src/utils/market_operation_utils/sampler_operations.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/asset-swapper/src/utils/market_operation_utils/cream_utils.ts b/packages/asset-swapper/src/utils/market_operation_utils/cream_utils.ts index f263270de3..a31e420b22 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/cream_utils.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/cream_utils.ts @@ -54,7 +54,7 @@ export class CreamPoolsCache { makerToken: string, isAllowedSource: boolean, ): { onChain: boolean; offChain: boolean } { - // If Balancer is excluded as a source, do not sample. + // If CREAM is excluded as a source, do not sample. if (!isAllowedSource) { return { onChain: false, offChain: false }; } @@ -63,7 +63,7 @@ export class CreamPoolsCache { // - Cached values are not stale // - There is at least one CREAM pool for this pair const onChain = cachedCreamPools !== undefined && cachedCreamPools.length > 0; - // Sample Balancer off-chain (i.e. via GraphQL query + `computeCreamBuy/SellQuote`) + // Sample CREAM off-chain (i.e. via GraphQL query + `computeCreamBuy/SellQuote`) // if cached values are stale const offChain = cachedCreamPools === undefined; return { onChain, offChain }; diff --git a/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts b/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts index bb37e24a60..d877ca9c93 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/sampler_operations.ts @@ -520,7 +520,7 @@ export class SamplerOperations { makerToken: string, takerToken: string, makerFillAmounts: BigNumber[], - ): Promise>>> { + ): Promise>>> { const pools = await this.creamPoolsCache.getPoolsForPairAsync(takerToken, makerToken); return pools.map(pool => makerFillAmounts.map(amount => ({ @@ -1109,7 +1109,7 @@ export class SamplerOperations { return this.creamPoolsCache .getCachedPoolAddressesForPair(takerToken, makerToken)! .map(poolAddress => - this.getBalancerSellQuotes(poolAddress, makerToken, takerToken, takerFillAmounts), + this.getCreamSellQuotes(poolAddress, makerToken, takerToken, takerFillAmounts), ); case ERC20BridgeSource.Shell: return this.getShellSellQuotes(makerToken, takerToken, takerFillAmounts); @@ -1206,7 +1206,7 @@ export class SamplerOperations { return this.creamPoolsCache .getCachedPoolAddressesForPair(takerToken, makerToken)! .map(poolAddress => - this.getBalancerBuyQuotes(poolAddress, makerToken, takerToken, makerFillAmounts), + this.getCreamBuyQuotes(poolAddress, makerToken, takerToken, makerFillAmounts), ); case ERC20BridgeSource.Shell: return this.getShellBuyQuotes(makerToken, takerToken, makerFillAmounts);