Commit 43f16dd0 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #2162 from tonykogias/remove-variable-in-whitelist.spec.ts

maintance: replaced l2Provider with env.l2Provider
parents 8ef006f7 45642dc8
---
'@eth-optimism/integration-tests': patch
---
Replaces l1Provider and l2Provider with env.l1Provider and env.l2Provider respectively.
......@@ -2,17 +2,11 @@
import { ethers } from 'hardhat'
import { expectApprox } from '@eth-optimism/core-utils'
import { predeploys } from '@eth-optimism/contracts'
import { asL2Provider } from '@eth-optimism/sdk'
import { Contract, BigNumber } from 'ethers'
/* Imports: Internal */
import { expect } from './shared/setup'
import {
l2Provider,
l1Provider,
envConfig,
DEFAULT_TEST_GAS_L1,
} from './shared/utils'
import { envConfig, DEFAULT_TEST_GAS_L1 } from './shared/utils'
import { OptimismEnv } from './shared/env'
/**
......@@ -21,7 +15,6 @@ import { OptimismEnv } from './shared/env'
* must be equal to the blocknumber/timestamp of the L1 transaction.
*/
describe('OVM Context: Layer 2 EVM Context', () => {
const L2Provider = asL2Provider(l2Provider)
let env: OptimismEnv
before(async () => {
env = await OptimismEnv.new()
......@@ -66,8 +59,10 @@ describe('OVM Context: Layer 2 EVM Context', () => {
// Get the L1 block that the enqueue transaction was in so that
// the timestamp can be compared against the layer two contract
const l1Block = await l1Provider.getBlock(pair.receipt.blockNumber)
const l2Block = await l2Provider.getBlock(pair.remoteReceipt.blockNumber)
const l1Block = await env.l1Provider.getBlock(pair.receipt.blockNumber)
const l2Block = await env.l2Provider.getBlock(
pair.remoteReceipt.blockNumber
)
// block.number should return the value of the L2 block number.
const l2BlockNumber = await OVMContextStorage.blockNumbers(i)
......@@ -103,7 +98,7 @@ describe('OVM Context: Layer 2 EVM Context', () => {
})
await dummyTx.wait()
const block = await L2Provider.getBlockWithTransactions('latest')
const block = await env.l2Provider.getBlockWithTransactions('latest')
const [, returnData] = await Multicall.callStatic.aggregate(
[
[
......
This diff is collapsed.
......@@ -6,7 +6,6 @@ import { predeploys } from '@eth-optimism/contracts'
/* Imports: Internal */
import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env'
import { l2Provider } from './shared/utils'
describe('Whitelist', async () => {
const initialAmount = 1000
......@@ -24,7 +23,7 @@ describe('Whitelist', async () => {
describe('when the whitelist is disabled', () => {
it('should be able to deploy a contract', async () => {
await expect(
l2Provider.send('eth_call', [
env.l2Provider.send('eth_call', [
Factory__ERC20.getDeployTransaction(
initialAmount,
tokenName,
......@@ -50,7 +49,7 @@ describe('Whitelist', async () => {
it('should fail if the user is not whitelisted', async () => {
await expect(
l2Provider.send('eth_call', [
env.l2Provider.send('eth_call', [
{
...Factory__ERC20.getDeployTransaction(
initialAmount,
......@@ -77,7 +76,7 @@ describe('Whitelist', async () => {
it('should succeed if the user is whitelisted', async () => {
await expect(
l2Provider.send('eth_call', [
env.l2Provider.send('eth_call', [
{
...Factory__ERC20.getDeployTransaction(
initialAmount,
......
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