Skip to content

Commit

Permalink
fix providers using dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed Jan 3, 2025
1 parent c99f468 commit 2425184
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/quote/swap/adapters/curve/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists'
import { getTokenByChainAndSymbol, isAddressEqual } from '@indexcoop/tokenlists'

import { ETH } from 'constants/tokens'
import { getAlchemyProviderUrl } from 'tests/utils'
Expand Down Expand Up @@ -33,8 +33,13 @@ describe('CurveSwapQuoteProvider', () => {
expect(quote.swapData?.exchange).toBe(Exchange.Curve)
expect(quote.swapData?.path.length).toBe(2)
expect(quote.swapData?.fees.length).toBe(0)
expect(quote.swapData?.path[0]).toEqual(weth)
expect(quote.swapData?.path[quote.swapData.path.length - 1]).toEqual(steth)
expect(isAddressEqual(quote.swapData?.path[0], weth)).toBe(true)
expect(
isAddressEqual(
quote.swapData?.path[quote.swapData.path.length - 1],
steth
)
).toBe(true)
expect(quote.swapData?.pool).toBe(curvePool)
// expect(quote.callData).not.toBe('0x')
expect(BigInt(quote.inputAmount) > BigInt(0)).toBe(true)
Expand All @@ -54,8 +59,13 @@ describe('CurveSwapQuoteProvider', () => {
expect(quote.swapData?.exchange).toBe(Exchange.Curve)
expect(quote.swapData?.path.length).toBe(2)
expect(quote.swapData?.fees.length).toBe(0)
expect(quote.swapData?.path[0]).toEqual(weth)
expect(quote.swapData?.path[quote.swapData.path.length - 1]).toEqual(steth)
expect(isAddressEqual(quote.swapData?.path[0], weth)).toBe(true)
expect(
isAddressEqual(
quote.swapData?.path[quote.swapData.path.length - 1],
steth
)
).toBe(true)
expect(quote.swapData?.pool).toBe(curvePool)
// expect(quote.callData).not.toBe('0x')
expect(BigInt(quote.inputAmount) > BigInt(0)).toBe(true)
Expand Down
2 changes: 2 additions & 0 deletions src/tests/utils/providers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import 'dotenv/config'

import { ChainId } from 'constants/chains'
import { getRpcProvider } from 'utils/rpc-provider'

Expand Down

0 comments on commit 2425184

Please sign in to comment.