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
e442dca1
Unverified
Commit
e442dca1
authored
Apr 28, 2021
by
Georgios Konstantopoulos
Committed by
GitHub
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: allow configuring integration tests with env vars (#669)
parent
bdba203d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
21 deletions
+25
-21
package.json
integration-tests/package.json
+1
-0
utils.ts
integration-tests/test/shared/utils.ts
+19
-21
yarn.lock
yarn.lock
+5
-0
No files found.
integration-tests/package.json
View file @
e442dca1
...
...
@@ -23,6 +23,7 @@
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
"chai"
:
"^4.3.3"
,
"chai-as-promised"
:
"^7.1.1"
,
"envalid"
:
"^7.1.0"
,
"ethereum-waffle"
:
"^3.3.0"
,
"ethers"
:
"^5.0.32"
,
"hardhat"
:
"^2.2.1"
,
...
...
integration-tests/test/shared/utils.ts
View file @
e442dca1
import
{
Direction
,
waitForXDomainTransaction
}
from
'
./watcher-utils
'
import
{
getContractFactory
,
getContractInterface
,
...
...
@@ -11,28 +13,28 @@ import {
BigNumberish
,
BigNumber
,
}
from
'
ethers
'
import
{
Direction
,
waitForXDomainTransaction
}
from
'
./watcher-utils
'
import
{
cleanEnv
,
str
,
num
}
from
'
envalid
'
export
const
GWEI
=
BigNumber
.
from
(
1
e9
)
const
env
=
cleanEnv
(
process
.
env
,
{
L1_URL
:
str
({
default
:
"
http://localhost:9545
"
}),
L2_URL
:
str
({
default
:
"
http://localhost:8545
"
}),
L1_POLLING_INTERVAL
:
num
({
default
:
10
}),
L2_POLLING_INTERVAL
:
num
({
default
:
10
}),
PRIVATE_KEY
:
str
({
default
:
'
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'
}),
ADDRESS_MANAGER
:
str
({
default
:
'
0x5FbDB2315678afecb367f032d93F642f64180aa3
'
})
})
// The hardhat instance
const
l1HttpPort
=
9545
export
const
l1Provider
=
new
providers
.
JsonRpcProvider
(
`http://localhost:
${
l1HttpPort
}
`
)
l1Provider
.
pollingInterval
=
10
const
httpPort
=
8545
export
const
l2Provider
=
new
providers
.
JsonRpcProvider
(
`http://localhost:
${
httpPort
}
`
)
l2Provider
.
pollingInterval
=
10
export
const
l1Provider
=
new
providers
.
JsonRpcProvider
(
env
.
L1_URL
)
l1Provider
.
pollingInterval
=
env
.
L1_POLLING_INTERVAL
export
const
l2Provider
=
new
providers
.
JsonRpcProvider
(
env
.
L2_URL
)
l2Provider
.
pollingInterval
=
env
.
L2_POLLING_INTERVAL
// The sequencer private key which is funded on L1
export
const
l1Wallet
=
new
Wallet
(
'
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'
,
l1Provider
)
export
const
l1Wallet
=
new
Wallet
(
env
.
PRIVATE_KEY
,
l1Provider
)
// A random private key which should always be funded with deposits from L1 -> L2
// if it's using non-0 gas price
...
...
@@ -43,14 +45,10 @@ export const PROXY_SEQUENCER_ENTRYPOINT_ADDRESS =
'
0x4200000000000000000000000000000000000004
'
export
const
OVM_ETH_ADDRESS
=
'
0x4200000000000000000000000000000000000006
'
// The address manager is always at the same address in testnet deployments
export
const
addressManagerAddress
=
'
0x5FbDB2315678afecb367f032d93F642f64180aa3
'
export
const
getAddressManager
=
(
provider
:
any
)
=>
{
return
getContractFactory
(
'
Lib_AddressManager
'
)
.
connect
(
provider
)
.
attach
(
addressManagerAddress
)
.
attach
(
env
.
ADDRESS_MANAGER
)
}
// Gets the gateway using the proxy if available
...
...
yarn.lock
View file @
e442dca1
...
...
@@ -5216,6 +5216,11 @@ env-paths@^2.2.0:
resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2"
integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==
envalid@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/envalid/-/envalid-7.1.0.tgz#fccc499abb257e3992d73b02d014c867a85e2a69"
integrity sha512-C5rtCxfj+ozW5q79fBYKcBEf0KSNklKwZudjCzXy9ANT8Pz1MKxPBn6unZnYXXy6e+cqVgnEURQeXmdueG9/kA==
envinfo@^7.7.4:
version "7.8.1"
resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475"
...
...
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