Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
45642dc8
Unverified
Commit
45642dc8
authored
Feb 11, 2022
by
Antonis Kogias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced l1Provider and l2Provider with env.l1Provider and env.l2Provider
parent
752a2d1f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
51 deletions
+52
-51
brown-foxes-hang.md
.changeset/brown-foxes-hang.md
+5
-0
ovmcontext.spec.ts
integration-tests/test/ovmcontext.spec.ts
+6
-11
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+38
-36
whitelist.spec.ts
integration-tests/test/whitelist.spec.ts
+3
-4
No files found.
.changeset/brown-foxes-hang.md
0 → 100644
View file @
45642dc8
---
'
@eth-optimism/integration-tests'
:
patch
---
Replaces l1Provider and l2Provider with env.l1Provider and env.l2Provider respectively.
integration-tests/test/ovmcontext.spec.ts
View file @
45642dc8
...
@@ -2,17 +2,11 @@
...
@@ -2,17 +2,11 @@
import
{
ethers
}
from
'
hardhat
'
import
{
ethers
}
from
'
hardhat
'
import
{
expectApprox
}
from
'
@eth-optimism/core-utils
'
import
{
expectApprox
}
from
'
@eth-optimism/core-utils
'
import
{
predeploys
}
from
'
@eth-optimism/contracts
'
import
{
predeploys
}
from
'
@eth-optimism/contracts
'
import
{
asL2Provider
}
from
'
@eth-optimism/sdk
'
import
{
Contract
,
BigNumber
}
from
'
ethers
'
import
{
Contract
,
BigNumber
}
from
'
ethers
'
/* Imports: Internal */
/* Imports: Internal */
import
{
expect
}
from
'
./shared/setup
'
import
{
expect
}
from
'
./shared/setup
'
import
{
import
{
envConfig
,
DEFAULT_TEST_GAS_L1
}
from
'
./shared/utils
'
l2Provider
,
l1Provider
,
envConfig
,
DEFAULT_TEST_GAS_L1
,
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
/**
/**
...
@@ -21,7 +15,6 @@ 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.
* must be equal to the blocknumber/timestamp of the L1 transaction.
*/
*/
describe
(
'
OVM Context: Layer 2 EVM Context
'
,
()
=>
{
describe
(
'
OVM Context: Layer 2 EVM Context
'
,
()
=>
{
const
L2Provider
=
asL2Provider
(
l2Provider
)
let
env
:
OptimismEnv
let
env
:
OptimismEnv
before
(
async
()
=>
{
before
(
async
()
=>
{
env
=
await
OptimismEnv
.
new
()
env
=
await
OptimismEnv
.
new
()
...
@@ -66,8 +59,10 @@ describe('OVM Context: Layer 2 EVM Context', () => {
...
@@ -66,8 +59,10 @@ describe('OVM Context: Layer 2 EVM Context', () => {
// Get the L1 block that the enqueue transaction was in so that
// Get the L1 block that the enqueue transaction was in so that
// the timestamp can be compared against the layer two contract
// the timestamp can be compared against the layer two contract
const
l1Block
=
await
l1Provider
.
getBlock
(
pair
.
receipt
.
blockNumber
)
const
l1Block
=
await
env
.
l1Provider
.
getBlock
(
pair
.
receipt
.
blockNumber
)
const
l2Block
=
await
l2Provider
.
getBlock
(
pair
.
remoteReceipt
.
blockNumber
)
const
l2Block
=
await
env
.
l2Provider
.
getBlock
(
pair
.
remoteReceipt
.
blockNumber
)
// block.number should return the value of the L2 block number.
// block.number should return the value of the L2 block number.
const
l2BlockNumber
=
await
OVMContextStorage
.
blockNumbers
(
i
)
const
l2BlockNumber
=
await
OVMContextStorage
.
blockNumbers
(
i
)
...
@@ -103,7 +98,7 @@ describe('OVM Context: Layer 2 EVM Context', () => {
...
@@ -103,7 +98,7 @@ describe('OVM Context: Layer 2 EVM Context', () => {
})
})
await
dummyTx
.
wait
()
await
dummyTx
.
wait
()
const
block
=
await
L
2Provider
.
getBlockWithTransactions
(
'
latest
'
)
const
block
=
await
env
.
l
2Provider
.
getBlockWithTransactions
(
'
latest
'
)
const
[,
returnData
]
=
await
Multicall
.
callStatic
.
aggregate
(
const
[,
returnData
]
=
await
Multicall
.
callStatic
.
aggregate
(
[
[
[
[
...
...
integration-tests/test/rpc.spec.ts
View file @
45642dc8
This diff is collapsed.
Click to expand it.
integration-tests/test/whitelist.spec.ts
View file @
45642dc8
...
@@ -6,7 +6,6 @@ import { predeploys } from '@eth-optimism/contracts'
...
@@ -6,7 +6,6 @@ import { predeploys } from '@eth-optimism/contracts'
/* Imports: Internal */
/* Imports: Internal */
import
{
expect
}
from
'
./shared/setup
'
import
{
expect
}
from
'
./shared/setup
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
l2Provider
}
from
'
./shared/utils
'
describe
(
'
Whitelist
'
,
async
()
=>
{
describe
(
'
Whitelist
'
,
async
()
=>
{
const
initialAmount
=
1000
const
initialAmount
=
1000
...
@@ -24,7 +23,7 @@ describe('Whitelist', async () => {
...
@@ -24,7 +23,7 @@ describe('Whitelist', async () => {
describe
(
'
when the whitelist is disabled
'
,
()
=>
{
describe
(
'
when the whitelist is disabled
'
,
()
=>
{
it
(
'
should be able to deploy a contract
'
,
async
()
=>
{
it
(
'
should be able to deploy a contract
'
,
async
()
=>
{
await
expect
(
await
expect
(
l2Provider
.
send
(
'
eth_call
'
,
[
env
.
l2Provider
.
send
(
'
eth_call
'
,
[
Factory__ERC20
.
getDeployTransaction
(
Factory__ERC20
.
getDeployTransaction
(
initialAmount
,
initialAmount
,
tokenName
,
tokenName
,
...
@@ -50,7 +49,7 @@ describe('Whitelist', async () => {
...
@@ -50,7 +49,7 @@ describe('Whitelist', async () => {
it
(
'
should fail if the user is not whitelisted
'
,
async
()
=>
{
it
(
'
should fail if the user is not whitelisted
'
,
async
()
=>
{
await
expect
(
await
expect
(
l2Provider
.
send
(
'
eth_call
'
,
[
env
.
l2Provider
.
send
(
'
eth_call
'
,
[
{
{
...
Factory__ERC20
.
getDeployTransaction
(
...
Factory__ERC20
.
getDeployTransaction
(
initialAmount
,
initialAmount
,
...
@@ -77,7 +76,7 @@ describe('Whitelist', async () => {
...
@@ -77,7 +76,7 @@ describe('Whitelist', async () => {
it
(
'
should succeed if the user is whitelisted
'
,
async
()
=>
{
it
(
'
should succeed if the user is whitelisted
'
,
async
()
=>
{
await
expect
(
await
expect
(
l2Provider
.
send
(
'
eth_call
'
,
[
env
.
l2Provider
.
send
(
'
eth_call
'
,
[
{
{
...
Factory__ERC20
.
getDeployTransaction
(
...
Factory__ERC20
.
getDeployTransaction
(
initialAmount
,
initialAmount
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment