Skip to content

Commit

Permalink
remove requirements zero ex v1 api for zero ex flash mint
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed May 23, 2024
1 parent ed2d76c commit 1f413b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/quote/indexQuoteProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
LocalhostProvider,
LocalhostProviderArbitrum,
QuoteTokens,
ZeroExApiSwapQuote,
} from 'tests/utils'
import {
getFlashMintLeveragedContractForToken,
Expand Down Expand Up @@ -145,7 +146,7 @@ describe('FlashMintQuoteProvider()', () => {
expect(quote.tx.data?.length).toBeGreaterThan(0)
})

test('returns a quote for minting ETH2X', async () => {
test.skip('returns a quote for minting ETH2X', async () => {
const arbitrumProvider = LocalhostProviderArbitrum
const inputToken = usdc
const outputToken = {
Expand Down Expand Up @@ -186,7 +187,7 @@ describe('FlashMintQuoteProvider()', () => {
expect(quote.tx.data?.length).toBeGreaterThan(0)
})

test('returns a quote for redeeming ETH2X', async () => {
test.skip('returns a quote for redeeming ETH2X', async () => {
const arbitrumProvider = LocalhostProviderArbitrum
const inputToken = {
address: IndexCoopEthereum2xIndex.addressArbitrum!,
Expand Down Expand Up @@ -244,7 +245,8 @@ describe('FlashMintQuoteProvider()', () => {
}
const quoteProvider = new FlashMintQuoteProvider(
provider,
zeroexSwapQuoteProvider
undefined,
ZeroExApiSwapQuote
)
const quote = await quoteProvider.getQuote(request)
if (!quote) fail()
Expand Down Expand Up @@ -279,7 +281,7 @@ describe('FlashMintQuoteProvider()', () => {
)
})

test('should fail if zeroExApiV1 is undefined for contract type zeroEx', async () => {
test('should fail if swap quote provider is undefined for contract type zeroEx', async () => {
const inputToken = usdc
const outputToken = mvi
const request: FlashMintQuoteRequest = {
Expand All @@ -291,7 +293,7 @@ describe('FlashMintQuoteProvider()', () => {
}
const quoteProvider = new FlashMintQuoteProvider(provider)
await expect(quoteProvider.getQuote(request)).rejects.toThrow(
'Contract type requires ZeroExApiV1 to be defined'
'Contract type requires SwapQuoteProvider to be defined'
)
})
})
1 change: 0 additions & 1 deletion src/quote/indexQuoteProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,5 @@ function getContractType(
function requiresZeroExV1(contractType: FlashMintContractType): boolean {
if (contractType === FlashMintContractType.leveraged) return true
if (contractType === FlashMintContractType.leveragedExtended) return true
if (contractType === FlashMintContractType.zeroEx) return true
return false
}

0 comments on commit 1f413b6

Please sign in to comment.