Commit 560036e3 authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2161 from tonykogias/replace-sleep-function-integration-tests

Replaced sleep function in integration-tests
parents 4080337f ff3a5b09
import { performance } from 'perf_hooks' import { performance } from 'perf_hooks'
import { Mutex } from 'async-mutex' import { Mutex } from 'async-mutex'
import { sleep } from '@eth-optimism/core-utils'
import { import {
sanitizeForMetrics, sanitizeForMetrics,
...@@ -11,7 +12,6 @@ import { ...@@ -11,7 +12,6 @@ import {
failedBenchRunsTotal, failedBenchRunsTotal,
} from './metrics' } from './metrics'
import { ActorLogger, WorkerLogger } from './logger' import { ActorLogger, WorkerLogger } from './logger'
import { sleep } from '../../test/shared/utils'
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
const asyncNoop = async () => {} const asyncNoop = async () => {}
......
/* Imports: External */
import { TransactionReceipt } from '@ethersproject/abstract-provider' import { TransactionReceipt } from '@ethersproject/abstract-provider'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { expect } from './shared/setup' import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env' import { OptimismEnv } from './shared/env'
import { import {
defaultTransactionFactory, defaultTransactionFactory,
gasPriceForL2, gasPriceForL2,
sleep,
envConfig, envConfig,
} from './shared/utils' } from './shared/utils'
......
import { expectApprox, injectL2Context } from '@eth-optimism/core-utils' /* Imports: External */
import { expectApprox, injectL2Context, sleep } from '@eth-optimism/core-utils'
import { Wallet, BigNumber, Contract, ContractFactory, constants } from 'ethers' import { Wallet, BigNumber, Contract, ContractFactory, constants } from 'ethers'
import { serialize } from '@ethersproject/transactions' import { serialize } from '@ethersproject/transactions'
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
...@@ -7,8 +8,8 @@ import { ...@@ -7,8 +8,8 @@ import {
TransactionRequest, TransactionRequest,
} from '@ethersproject/providers' } from '@ethersproject/providers'
/* Imports: Internal */
import { import {
sleep,
l2Provider, l2Provider,
defaultTransactionFactory, defaultTransactionFactory,
fundUser, fundUser,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { Contract, utils, Wallet, providers } from 'ethers' import { Contract, utils, Wallet, providers } from 'ethers'
import { TransactionResponse } from '@ethersproject/providers' import { TransactionResponse } from '@ethersproject/providers'
import { getContractFactory, predeploys } from '@eth-optimism/contracts' import { getContractFactory, predeploys } from '@eth-optimism/contracts'
import { Watcher } from '@eth-optimism/core-utils' import { Watcher, sleep } from '@eth-optimism/core-utils'
import { getMessagesAndProofsForL2Transaction } from '@eth-optimism/message-relayer' import { getMessagesAndProofsForL2Transaction } from '@eth-optimism/message-relayer'
import { CrossChainMessenger } from '@eth-optimism/sdk' import { CrossChainMessenger } from '@eth-optimism/sdk'
...@@ -20,7 +20,6 @@ import { ...@@ -20,7 +20,6 @@ import {
getOvmEth, getOvmEth,
getL1Bridge, getL1Bridge,
getL2Bridge, getL2Bridge,
sleep,
envConfig, envConfig,
DEFAULT_TEST_GAS_L1, DEFAULT_TEST_GAS_L1,
} from './utils' } from './utils'
......
/* Imports: External */ /* Imports: External */
import { ethers } from 'ethers' import { ethers } from 'ethers'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */ /* Imports: Internal */
import { OptimismEnv } from './env' import { OptimismEnv } from './env'
import { Direction } from './watcher-utils' import { Direction } from './watcher-utils'
import { gasPriceForL1, gasPriceForL2, sleep } from './utils' import { gasPriceForL1, gasPriceForL2 } from './utils'
interface TransactionParams { interface TransactionParams {
contract: ethers.Contract contract: ethers.Contract
......
...@@ -237,8 +237,6 @@ export const hardhatTest = (name, fn) => ...@@ -237,8 +237,6 @@ export const hardhatTest = (name, fn) =>
'Skipping test on non-Hardhat environment.' 'Skipping test on non-Hardhat environment.'
) )
export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))
const abiCoder = new utils.AbiCoder() const abiCoder = new utils.AbiCoder()
export const encodeSolidityRevertMessage = (_reason: string): string => { export const encodeSolidityRevertMessage = (_reason: string): string => {
return '0x08c379a0' + remove0x(abiCoder.encode(['string'], [_reason])) return '0x08c379a0' + remove0x(abiCoder.encode(['string'], [_reason]))
......
/* Imports: External */
import { TransactionReceipt } from '@ethersproject/abstract-provider' import { TransactionReceipt } from '@ethersproject/abstract-provider'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { expect } from './shared/setup' import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env' import { OptimismEnv } from './shared/env'
import { import {
defaultTransactionFactory, defaultTransactionFactory,
gasPriceForL2, gasPriceForL2,
sleep,
envConfig, envConfig,
} from './shared/utils' } from './shared/utils'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment