Skip to content

Commit

Permalink
add test for iceth-weth
Browse files Browse the repository at this point in the history
  • Loading branch information
janndriessen committed Feb 14, 2024
1 parent b1928bf commit 7281e2e
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/tests/iceth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
SignerAccount4,
TestFactory,
wei,
wrapETH,
ZeroExApiSwapQuote,
} from './utils'

const { eth, iceth } = QuoteTokens
const { eth, iceth, weth } = QuoteTokens
const zeroExApi = ZeroExApiSwapQuote

describe('icETH (mainnet)', () => {
Expand Down Expand Up @@ -41,4 +42,27 @@ describe('icETH (mainnet)', () => {
})
await factory.executeTx(BigNumber.from(5_000_000))
})

test('can mint with WETH', async () => {
const quote = await factory.fetchQuote({
isMinting: true,
inputToken: weth,
outputToken: iceth,
indexTokenAmount: wei('0.1'),
slippage: 1,
})
await wrapETH(quote.inputOutputAmount, factory.getSigner())
await factory.executeTx()
})

test('can redeem for WETH', async () => {
await factory.fetchQuote({
isMinting: false,
inputToken: iceth,
outputToken: weth,
indexTokenAmount: wei('0.1'),
slippage: 1,
})
await factory.executeTx()
})
})

0 comments on commit 7281e2e

Please sign in to comment.