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 { Mutex } from 'async-mutex'
import { sleep } from '@eth-optimism/core-utils'
import {
sanitizeForMetrics,
......@@ -11,7 +12,6 @@ import {
failedBenchRunsTotal,
} from './metrics'
import { ActorLogger, WorkerLogger } from './logger'
import { sleep } from '../../test/shared/utils'
// eslint-disable-next-line @typescript-eslint/no-empty-function
const asyncNoop = async () => {}
......
/* Imports: External */
import { TransactionReceipt } from '@ethersproject/abstract-provider'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env'
import {
defaultTransactionFactory,
gasPriceForL2,
sleep,
envConfig,
} 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 { serialize } from '@ethersproject/transactions'
import { ethers } from 'hardhat'
......@@ -7,8 +8,8 @@ import {
TransactionRequest,
} from '@ethersproject/providers'
/* Imports: Internal */
import {
sleep,
l2Provider,
defaultTransactionFactory,
fundUser,
......
......@@ -2,7 +2,7 @@
import { Contract, utils, Wallet, providers } from 'ethers'
import { TransactionResponse } from '@ethersproject/providers'
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 { CrossChainMessenger } from '@eth-optimism/sdk'
......@@ -20,7 +20,6 @@ import {
getOvmEth,
getL1Bridge,
getL2Bridge,
sleep,
envConfig,
DEFAULT_TEST_GAS_L1,
} from './utils'
......
/* Imports: External */
import { ethers } from 'ethers'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { OptimismEnv } from './env'
import { Direction } from './watcher-utils'
import { gasPriceForL1, gasPriceForL2, sleep } from './utils'
import { gasPriceForL1, gasPriceForL2 } from './utils'
interface TransactionParams {
contract: ethers.Contract
......
......@@ -237,8 +237,6 @@ export const hardhatTest = (name, fn) =>
'Skipping test on non-Hardhat environment.'
)
export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))
const abiCoder = new utils.AbiCoder()
export const encodeSolidityRevertMessage = (_reason: string): string => {
return '0x08c379a0' + remove0x(abiCoder.encode(['string'], [_reason]))
......
/* Imports: External */
import { TransactionReceipt } from '@ethersproject/abstract-provider'
import { sleep } from '@eth-optimism/core-utils'
/* Imports: Internal */
import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env'
import {
defaultTransactionFactory,
gasPriceForL2,
sleep,
envConfig,
} 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