Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilz committed Sep 14, 2023
1 parent 242d110 commit be68f1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
15 changes: 4 additions & 11 deletions test/integration-tests/Uniswap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { encodePath } from './shared/swapRouter02Helpers'
import { BigNumber, BigNumberish } from 'ethers'
import { Permit2, UniversalRouter } from '../../typechain'
import { abi as TOKEN_ABI } from '../../artifacts/solmate/src/tokens/ERC20.sol/ERC20.json'
import { abi as STETH_ABI } from '../../artifacts/contracts/interfaces/external/ISTETH.sol/ISTETH.json'
import { abi as STETH_ABI } from '../../artifacts/contracts/interfaces/external/ISTETH.sol/ISTETH.json'
import { resetFork, WETH, DAI, USDC, USDT, STETH, WSTETH } from './shared/mainnetForkHelpers'
import {
ADDRESS_THIS,
Expand Down Expand Up @@ -591,7 +591,7 @@ describe('Uniswap V2 and V3 Tests:', () => {
})

describe('STETH', () => {
const STETH_DUST = 1;
const STETH_DUST = 1

it('completes a V3 exactIn with STETH --> WETH', async () => {
const { stethContract } = await setupStethContext()
Expand All @@ -613,10 +613,7 @@ describe('Uniswap V2 and V3 Tests:', () => {
)

const stethBalanceBefore = await stethContract.balanceOf(bob.address)
const {
wethBalanceBefore,
wethBalanceAfter,
} = await executeRouter(planner)
const { wethBalanceBefore, wethBalanceAfter } = await executeRouter(planner)
const stethBalanceAfter = await stethContract.balanceOf(bob.address)

expect(stethBalanceBefore.sub(stethBalanceAfter)).to.eq(amountInSTETH.sub(STETH_DUST))
Expand All @@ -642,10 +639,7 @@ describe('Uniswap V2 and V3 Tests:', () => {

const wstethBalanceBefore = await wstethContract.balanceOf(bob.address)
const stethBalanceBefore = await stethContract.balanceOf(bob.address)
const {
wethBalanceBefore,
wethBalanceAfter,
} = await executeRouter(planner)
const { wethBalanceBefore, wethBalanceAfter } = await executeRouter(planner)
const wstethBalanceAfter = await wstethContract.balanceOf(bob.address)
const stethBalanceAfter = await stethContract.balanceOf(bob.address)

Expand Down Expand Up @@ -1345,7 +1339,6 @@ describe('Uniswap V2 and V3 Tests:', () => {
let wstethContract = new ethers.Contract(WSTETH.address, TOKEN_ABI, bob)
let wethContract = new ethers.Contract(WETH.address, TOKEN_ABI, bob)


// alice gives bob some tokens
await wethContract.connect(alice).transfer(bob.address, expandTo18DecimalsBN(100))
await stethContract.connect(alice).transfer(bob.address, expandTo18DecimalsBN(0.3))
Expand Down
17 changes: 12 additions & 5 deletions test/integration-tests/gas-tests/Uniswap.gas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ import {
import { BigNumber, BigNumberish } from 'ethers'
import { UniversalRouter, Permit2 } from '../../../typechain'
import { abi as TOKEN_ABI } from '../../../artifacts/solmate/src/tokens/ERC20.sol/ERC20.json'
import { abi as STETH_ABI } from '../../../artifacts/contracts/interfaces/external/ISTETH.sol/ISTETH.json'
import { approveAndExecuteSwapRouter02, resetFork, WETH, DAI, USDC, USDT, STETH, WSTETH } from '../shared/mainnetForkHelpers'
import { abi as STETH_ABI } from '../../../artifacts/contracts/interfaces/external/ISTETH.sol/ISTETH.json'
import {
approveAndExecuteSwapRouter02,
resetFork,
WETH,
DAI,
USDC,
USDT,
STETH,
WSTETH,
} from '../shared/mainnetForkHelpers'
import {
ADDRESS_THIS,
ALICE_ADDRESS,
Expand Down Expand Up @@ -680,7 +689,7 @@ describe('Uniswap Gas Tests', () => {
})

describe('STETH', () => {
const STETH_DUST = 1;
const STETH_DUST = 1

it('gas: completes a V3 exactIn with STETH --> WETH', async () => {
const { stethContract, wstethContract, wethContract } = await setupStethContext()
Expand Down Expand Up @@ -1265,7 +1274,6 @@ describe('Uniswap Gas Tests', () => {
let wstethContract = new ethers.Contract(WSTETH.address, TOKEN_ABI, bob)
let wethContract = new ethers.Contract(WETH.address, TOKEN_ABI, bob)


// alice gives bob some tokens
await wethContract.connect(alice).transfer(bob.address, expandTo18DecimalsBN(100))
await stethContract.connect(alice).transfer(bob.address, expandTo18DecimalsBN(0.3))
Expand All @@ -1278,5 +1286,4 @@ describe('Uniswap Gas Tests', () => {

return { stethContract, wstethContract, wethContract }
}

})

0 comments on commit be68f1f

Please sign in to comment.