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
968fb38d
Commit
968fb38d
authored
Jan 17, 2022
by
Patrice Vignola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: use hardhat-ethers for importing factories in integration tests
parent
3174f034
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
30 deletions
+23
-30
spicy-kiwis-double.md
.changeset/spicy-kiwis-double.md
+5
-0
state-dos.test.ts
integration-tests/actor-tests/state-dos.test.ts
+3
-7
basic-l1-l2-communication.spec.ts
integration-tests/test/basic-l1-l2-communication.spec.ts
+7
-11
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+2
-4
stress-tests.spec.ts
integration-tests/test/stress-tests.spec.ts
+6
-8
No files found.
.changeset/spicy-kiwis-double.md
0 → 100644
View file @
968fb38d
---
'
@eth-optimism/integration-tests'
:
patch
---
Use hardhat-ethers for importing factories in integration tests
integration-tests/actor-tests/state-dos.test.ts
View file @
968fb38d
import
{
utils
,
Wallet
,
Contract
,
ContractFactory
}
from
'
ethers
'
import
{
utils
,
Wallet
,
Contract
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
import
{
actor
,
setupActor
,
run
,
setupRun
}
from
'
./lib/convenience
'
import
{
OptimismEnv
}
from
'
../test/shared/env
'
import
StateDOS
from
'
../artifacts/contracts/StateDOS.sol/StateDOS.json
'
import
{
expect
}
from
'
chai
'
interface
Context
{
...
...
@@ -16,11 +16,7 @@ actor('Trie DoS accounts', () => {
setupActor
(
async
()
=>
{
env
=
await
OptimismEnv
.
new
()
const
factory
=
new
ContractFactory
(
StateDOS
.
abi
,
StateDOS
.
bytecode
,
env
.
l2Wallet
)
const
factory
=
await
ethers
.
getContractFactory
(
'
StateDOS
'
,
env
.
l2Wallet
)
contract
=
await
factory
.
deploy
()
await
contract
.
deployed
()
})
...
...
integration-tests/test/basic-l1-l2-communication.spec.ts
View file @
968fb38d
...
...
@@ -2,11 +2,10 @@ import { expect } from './shared/setup'
/* Imports: External */
import
{
Contract
,
ContractFactory
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
import
{
applyL1ToL2Alias
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
simpleStorageJson
from
'
../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
l2ReverterJson
from
'
../artifacts/contracts/Reverter.sol/Reverter.json
'
import
{
Direction
}
from
'
./shared/watcher-utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
isMainnet
}
from
'
./shared/utils
'
...
...
@@ -22,19 +21,16 @@ describe('Basic L1<>L2 Communication', async () => {
before
(
async
()
=>
{
env
=
await
OptimismEnv
.
new
()
Factory__L1SimpleStorage
=
new
ContractFactory
(
simpleStorageJson
.
abi
,
simpleStorageJson
.
bytecode
,
Factory__L1SimpleStorage
=
await
ethers
.
getContractFactory
(
'
SimpleStorage
'
,
env
.
l1Wallet
)
Factory__L2SimpleStorage
=
new
ContractFactory
(
simpleStorageJson
.
abi
,
simpleStorageJson
.
bytecode
,
Factory__L2SimpleStorage
=
await
ethers
.
getContractFactory
(
'
SimpleStorage
'
,
env
.
l2Wallet
)
Factory__L2Reverter
=
new
ContractFactory
(
l2ReverterJson
.
abi
,
l2ReverterJson
.
bytecode
,
Factory__L2Reverter
=
await
ethers
.
getContractFactory
(
'
Reverter
'
,
env
.
l2Wallet
)
})
...
...
integration-tests/test/rpc.spec.ts
View file @
968fb38d
...
...
@@ -18,7 +18,6 @@ import {
TransactionReceipt
,
TransactionRequest
,
}
from
'
@ethersproject/providers
'
import
simpleStorageJson
from
'
../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json
'
describe
(
'
Basic RPC tests
'
,
()
=>
{
let
env
:
OptimismEnv
...
...
@@ -491,9 +490,8 @@ describe('Basic RPC tests', () => {
describe
(
'
debug_traceTransaction
'
,
()
=>
{
it
(
'
should match debug_traceBlock
'
,
async
()
=>
{
const
storage
=
new
ContractFactory
(
simpleStorageJson
.
abi
,
simpleStorageJson
.
bytecode
,
const
storage
=
await
ethers
.
getContractFactory
(
'
SimpleStorage
'
,
env
.
l2Wallet
)
const
tx
=
(
await
storage
.
deploy
()).
deployTransaction
...
...
integration-tests/test/stress-tests.spec.ts
View file @
968fb38d
import
{
expect
}
from
'
./shared/setup
'
/* Imports: External */
import
{
Contract
,
ContractFactory
,
Wallet
,
utils
}
from
'
ethers
'
import
{
Contract
,
Wallet
,
utils
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
/* Imports: Internal */
import
{
OptimismEnv
}
from
'
./shared/env
'
...
...
@@ -16,7 +17,6 @@ import {
}
from
'
./shared/stress-test-helpers
'
/* Imports: Artifacts */
import
simpleStorageJson
from
'
../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
{
fundUser
,
isLiveNetwork
,
isMainnet
}
from
'
./shared/utils
'
// Need a big timeout to allow for all transactions to be processed.
...
...
@@ -60,14 +60,12 @@ describe('stress tests', () => {
let
L2SimpleStorage
:
Contract
let
L1SimpleStorage
:
Contract
beforeEach
(
async
()
=>
{
const
factory__L1SimpleStorage
=
new
ContractFactory
(
simpleStorageJson
.
abi
,
simpleStorageJson
.
bytecode
,
const
factory__L1SimpleStorage
=
await
ethers
.
getContractFactory
(
'
SimpleStorage
'
,
env
.
l1Wallet
)
const
factory__L2SimpleStorage
=
new
ContractFactory
(
simpleStorageJson
.
abi
,
simpleStorageJson
.
bytecode
,
const
factory__L2SimpleStorage
=
await
ethers
.
getContractFactory
(
'
SimpleStorage
'
,
env
.
l2Wallet
)
L1SimpleStorage
=
await
factory__L1SimpleStorage
.
deploy
()
...
...
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