Skip to content

Commit

Permalink
fix last todos
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed Feb 25, 2025
1 parent 0d10f11 commit 2c9d497
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/quote/provider/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists'
import { ChainId } from 'constants/chains'
import { Contracts } from 'constants/contracts'
import { IndexCoopEthereum2xIndex } from 'constants/tokens'
import { StaticSwapQuoteProvider } from 'quote/swap/adapters/static'
import { getFlashMintLeveragedContractForToken, wei } from 'utils'
import { getRpcProvider } from 'utils/rpc-provider'

Expand Down Expand Up @@ -55,12 +56,11 @@ describe('FlashMintQuoteProvider()', () => {
)
})

// TODO:
test.skip('returns a quote for minting BTC2X', async () => {
test('returns a quote for minting BTC2X', async () => {
const chainID = ChainId.Base
const rpcUrl = getLocalHostProviderUrl(chainID)
const baseProvider = getRpcProvider(rpcUrl)
const inputToken = usdc
const inputToken = getTokenByChainAndSymbol(chainID, 'USDC')
const outputToken = getTokenByChainAndSymbol(chainID, 'BTC2X')
const contract = getFlashMintLeveragedContractForToken(
outputToken.symbol,
Expand All @@ -72,18 +72,18 @@ describe('FlashMintQuoteProvider()', () => {
inputToken,
outputToken,
indexTokenAmount: wei(1).toString(),
inputTokenAmount: wei(0.5).toString(),
inputTokenAmount: wei(500).toString(),
slippage: 0.5,
}
const quoteProvider = new FlashMintQuoteProvider(
rpcUrl,
getZeroExSwapQuoteProvider(chainID),
)
const swapQuoteProvider = new StaticSwapQuoteProvider()
const quoteProvider = new FlashMintQuoteProvider(rpcUrl, swapQuoteProvider)
const quote = await quoteProvider.getQuote(request)
if (!quote) fail()
const chainId = (await baseProvider.getNetwork()).chainId
expect(quote.chainId).toEqual(chainId)
expect(quote.contractType).toEqual(FlashMintContractType.leveragedAerodrome)
expect(quote.contractType).toEqual(
FlashMintContractType.leveragedMorphoAaveLM,
)
expect(quote.contract).toEqual(contract.address)
expect(quote.isMinting).toEqual(request.isMinting)
expect(quote.inputToken).toEqual(request.inputToken)
Expand Down
1 change: 0 additions & 1 deletion src/quote/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ export class FlashMintQuoteProvider
outputAmount: isMinting
? request.indexTokenAmount
: request.inputTokenAmount!,
// TODO:
taker: '0x0',
})
if (!leveragedAerodromeQuote) return null
Expand Down
1 change: 0 additions & 1 deletion src/quote/swap/adapters/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class StaticSwapQuoteProvider implements SwapQuoteProviderV2 {
fees: [],
pool: AddressZero,
poolIds: [],
// TODO: check all pools
tickSpacing: [100],
}

Expand Down

0 comments on commit 2c9d497

Please sign in to comment.