diff --git a/src/quote/flashmint/wrapped/provider.test.ts b/src/quote/flashmint/wrapped/provider.test.ts index c2eb34c1..68dd84d3 100644 --- a/src/quote/flashmint/wrapped/provider.test.ts +++ b/src/quote/flashmint/wrapped/provider.test.ts @@ -1,22 +1,29 @@ -import { LocalhostProviderUrl, QuoteTokens } from 'tests/utils' +import { + IndexZeroExSwapQuoteProvider, + LocalhostProviderUrl, + QuoteTokens, +} from 'tests/utils' import { wei } from 'utils/numbers' import { FlashMintWrappedQuoteRequest, WrappedQuoteProvider } from '.' const { usdc, usdcy, weth } = QuoteTokens const indexToken = usdcy +const chainId = 1 const provider = LocalhostProviderUrl +const swapQuoteProvider = IndexZeroExSwapQuoteProvider describe('WrappedQuoteProvider()', () => { test.only('returns a quote for minting USDCY', async () => { const inputToken = usdc const request: FlashMintWrappedQuoteRequest = { + chainId, isMinting: true, inputToken, outputToken: indexToken, indexTokenAmount: wei(1), slippage: 0.5, } - const quoteProvider = new WrappedQuoteProvider(provider) + const quoteProvider = new WrappedQuoteProvider(provider, swapQuoteProvider) const quote = await quoteProvider.getQuote(request) if (!quote) fail() expect(quote.indexTokenAmount).toEqual(request.indexTokenAmount) @@ -29,13 +36,14 @@ describe('WrappedQuoteProvider()', () => { test('returns a quote for minting MMI w/ USDC', async () => { const inputToken = usdc const request: FlashMintWrappedQuoteRequest = { + chainId, isMinting: true, inputToken, outputToken: indexToken, indexTokenAmount: wei(1), slippage: 0.5, } - const quoteProvider = new WrappedQuoteProvider(provider) + const quoteProvider = new WrappedQuoteProvider(provider, swapQuoteProvider) const quote = await quoteProvider.getQuote(request) if (!quote) fail() expect(quote.indexTokenAmount).toEqual(request.indexTokenAmount) @@ -46,13 +54,14 @@ describe('WrappedQuoteProvider()', () => { test('returns a quote for minting MMI w/ WETH', async () => { const inputToken = weth const request: FlashMintWrappedQuoteRequest = { + chainId, isMinting: true, inputToken, outputToken: indexToken, indexTokenAmount: wei(1), slippage: 0.5, } - const quoteProvider = new WrappedQuoteProvider(provider) + const quoteProvider = new WrappedQuoteProvider(provider, swapQuoteProvider) const quote = await quoteProvider.getQuote(request) if (!quote) fail() expect(quote.indexTokenAmount).toEqual(request.indexTokenAmount) @@ -63,13 +72,14 @@ describe('WrappedQuoteProvider()', () => { test.only('returns a quote redeeming USDCY for USDC', async () => { const outputToken = usdc const request: FlashMintWrappedQuoteRequest = { + chainId, isMinting: false, inputToken: indexToken, outputToken, indexTokenAmount: wei(1), slippage: 0.5, } - const quoteProvider = new WrappedQuoteProvider(provider) + const quoteProvider = new WrappedQuoteProvider(provider, swapQuoteProvider) const quote = await quoteProvider.getQuote(request) if (!quote) fail() expect(quote.indexTokenAmount).toEqual(request.indexTokenAmount) @@ -82,13 +92,14 @@ describe('WrappedQuoteProvider()', () => { test('returns a quote for redeeming MMI for WETH', async () => { const outputToken = weth const request: FlashMintWrappedQuoteRequest = { + chainId, isMinting: false, inputToken: indexToken, outputToken, indexTokenAmount: wei(1), slippage: 0.5, } - const quoteProvider = new WrappedQuoteProvider(provider) + const quoteProvider = new WrappedQuoteProvider(provider, swapQuoteProvider) const quote = await quoteProvider.getQuote(request) if (!quote) fail() expect(quote.indexTokenAmount).toEqual(request.indexTokenAmount)