From 5079ce33f43fa7b0596666516bb228fc68ab3bb1 Mon Sep 17 00:00:00 2001 From: lucadonnoh Date: Wed, 19 Jan 2022 20:16:47 +0100 Subject: [PATCH] (feat): internal and external import separation --- integration-tests/test/bridged-tokens.spec.ts | 2 ++ integration-tests/test/contracts.spec.ts | 7 ++++--- integration-tests/test/native-eth-ovm-calls.spec.ts | 3 +++ integration-tests/test/predeploys.spec.ts | 4 ++-- integration-tests/test/queue-ingestion.spec.ts | 4 ++-- integration-tests/test/replica.spec.ts | 6 +++++- integration-tests/test/rpc.spec.ts | 11 +++++++---- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/integration-tests/test/bridged-tokens.spec.ts b/integration-tests/test/bridged-tokens.spec.ts index f992f2aad7769..3817924e7d0b1 100644 --- a/integration-tests/test/bridged-tokens.spec.ts +++ b/integration-tests/test/bridged-tokens.spec.ts @@ -1,9 +1,11 @@ import { expect } from './shared/setup' +/* Imports: External */ import { BigNumber, Contract, ContractFactory, utils, Wallet } from 'ethers' import { ethers } from 'hardhat' import * as L2Artifact from '@eth-optimism/contracts/artifacts/contracts/standards/L2StandardERC20.sol/L2StandardERC20.json' +/* Imports: Internal */ import { OptimismEnv } from './shared/env' import { isLiveNetwork, isMainnet } from './shared/utils' import { Direction } from './shared/watcher-utils' diff --git a/integration-tests/test/contracts.spec.ts b/integration-tests/test/contracts.spec.ts index 521a705be7699..13fad6cf1c7ae 100644 --- a/integration-tests/test/contracts.spec.ts +++ b/integration-tests/test/contracts.spec.ts @@ -1,15 +1,16 @@ import { expect } from './shared/setup' +/* Imports: External */ import { BigNumber, Contract, ContractFactory, utils, Wallet } from 'ethers' import { ethers } from 'hardhat' import { UniswapV3Deployer } from 'uniswap-v3-deploy-plugin/dist/deployer/UniswapV3Deployer' - -import { OptimismEnv } from './shared/env' import { FeeAmount, TICK_SPACINGS } from '@uniswap/v3-sdk' - import { abi as NFTABI } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json' import { abi as RouterABI } from '@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json' +/* Imports: Internal */ +import { OptimismEnv } from './shared/env' + // Below methods taken from the Uniswap test suite, see // https://github.com/Uniswap/v3-periphery/blob/main/test/shared/ticks.ts const getMinTick = (tickSpacing: number) => diff --git a/integration-tests/test/native-eth-ovm-calls.spec.ts b/integration-tests/test/native-eth-ovm-calls.spec.ts index ae6261435baa8..583945c79290f 100644 --- a/integration-tests/test/native-eth-ovm-calls.spec.ts +++ b/integration-tests/test/native-eth-ovm-calls.spec.ts @@ -1,7 +1,10 @@ import { expect } from './shared/setup' +/* Imports: External */ import { BigNumber, Contract, ContractFactory, Wallet } from 'ethers' import { ethers } from 'hardhat' + +/* Imports: Internal */ import { fundUser, encodeSolidityRevertMessage, diff --git a/integration-tests/test/predeploys.spec.ts b/integration-tests/test/predeploys.spec.ts index 57131585dc6b3..1f9698cd87daa 100644 --- a/integration-tests/test/predeploys.spec.ts +++ b/integration-tests/test/predeploys.spec.ts @@ -1,10 +1,10 @@ import { expect } from './shared/setup' -/* Imports: Internal */ +/* Imports: External */ import { ethers } from 'ethers' import { predeploys, getContractInterface } from '@eth-optimism/contracts' -/* Imports: External */ +/* Imports: Internal */ import { OptimismEnv } from './shared/env' describe('predeploys', () => { diff --git a/integration-tests/test/queue-ingestion.spec.ts b/integration-tests/test/queue-ingestion.spec.ts index c79de341600c2..b754c9d4e1d19 100644 --- a/integration-tests/test/queue-ingestion.spec.ts +++ b/integration-tests/test/queue-ingestion.spec.ts @@ -1,10 +1,10 @@ import { expect } from './shared/setup' -/* Imports: Internal */ +/* Imports: External */ import { providers } from 'ethers' import { injectL2Context, applyL1ToL2Alias } from '@eth-optimism/core-utils' -/* Imports: External */ +/* Imports: Internal */ import { OptimismEnv } from './shared/env' import { Direction } from './shared/watcher-utils' import { isLiveNetwork } from './shared/utils' diff --git a/integration-tests/test/replica.spec.ts b/integration-tests/test/replica.spec.ts index 6f157ae2feb18..f66d61f55b11f 100644 --- a/integration-tests/test/replica.spec.ts +++ b/integration-tests/test/replica.spec.ts @@ -1,4 +1,9 @@ import { expect } from './shared/setup' + +/* Imports: External */ +import { TransactionReceipt } from '@ethersproject/abstract-provider' + +/* Imports: Internal */ import { OptimismEnv } from './shared/env' import { defaultTransactionFactory, @@ -6,7 +11,6 @@ import { sleep, isLiveNetwork, } from './shared/utils' -import { TransactionReceipt } from '@ethersproject/abstract-provider' describe('Replica Tests', () => { let env: OptimismEnv diff --git a/integration-tests/test/rpc.spec.ts b/integration-tests/test/rpc.spec.ts index b02dc0ac487e8..f0d6035e8d42d 100644 --- a/integration-tests/test/rpc.spec.ts +++ b/integration-tests/test/rpc.spec.ts @@ -1,9 +1,16 @@ import { expect } from './shared/setup' +/* Imports: External */ import { expectApprox, injectL2Context } from '@eth-optimism/core-utils' import { Wallet, BigNumber, Contract, ContractFactory, constants } from 'ethers' import { serialize } from '@ethersproject/transactions' import { ethers } from 'hardhat' +import { + TransactionReceipt, + TransactionRequest, +} from '@ethersproject/providers' + +/* Imports: Internal */ import { sleep, l2Provider, @@ -14,10 +21,6 @@ import { gasPriceForL2, } from './shared/utils' import { OptimismEnv } from './shared/env' -import { - TransactionReceipt, - TransactionRequest, -} from '@ethersproject/providers' import simpleStorageJson from '../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json' describe('Basic RPC tests', () => {