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
0832d788
Unverified
Commit
0832d788
authored
Apr 01, 2024
by
Will Cory
Committed by
GitHub
Apr 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: make sdk-next tests run in ci (#10003)
Co-authored-by:
Will Cory
<
willcory@Wills-MacBook-Pro.local
>
parent
65837359
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
39 deletions
+123
-39
config.yml
.circleci/config.yml
+9
-12
README.md
packages/sdk/test-next/README.md
+3
-3
bridgeEcoToken.spec.ts
packages/sdk/test-next/bridgeEcoToken.spec.ts
+1
-1
messageStatus.spec.ts
packages/sdk/test-next/messageStatus.spec.ts
+1
-1
proveMessage.spec.ts
packages/sdk/test-next/proveMessage.spec.ts
+1
-1
ethersProviders.ts
packages/sdk/test-next/testUtils/ethersProviders.ts
+35
-5
viemClients.ts
packages/sdk/test-next/testUtils/viemClients.ts
+73
-16
No files found.
.circleci/config.yml
View file @
0832d788
...
...
@@ -682,22 +682,22 @@ jobs:
keys
:
-
pnpm-packages-v2-{{ checksum "pnpm.lock.yaml" }}
-
check-changed
:
patterns
:
sdk
,contracts-bedrock,contracts
patterns
:
sdk
# populate node modules from the cache
-
run
:
name
:
Install dependencies
command
:
pnpm install:ci
-
run
:
name
:
anvil-l1
name
:
sepolia-fork
background
:
true
# atm this is goerli but we should use mainnet after bedrock is live
command
:
anvil --fork-url $ANVIL_
L1_FORK_URL --fork-block-number
9256679
command
:
anvil --fork-url $ANVIL_
SEPOLIA_FORK_URL --fork-block-number 5580113 --port
8545
-
run
:
name
:
anvil-l2
name
:
op-sepolia-fork
background
:
true
# atm this is goerli but we should use mainnet after bedrock is live
command
:
anvil --fork-url $ANVIL_
L2_FORK_URL --port 9545 --fork-block-number
11276409
command
:
anvil --fork-url $ANVIL_
OP_SEPOLIA_FORK_URL --port 9545 --fork-block-number
9925328
-
run
:
name
:
build
...
...
@@ -1544,13 +1544,6 @@ workflows:
dependencies
:
'
(contracts-bedrock|contracts-ts)'
requires
:
-
pnpm-monorepo
-
js-lint-test
:
name
:
sdk-next-tests
coverage_flag
:
sdk-next-tests
package_name
:
sdk
dependencies
:
"
(common-ts|contracts-bedrock|core-utils)"
requires
:
-
pnpm-monorepo
-
js-lint-test
:
name
:
sdk-tests
coverage_flag
:
sdk-tests
...
...
@@ -1565,6 +1558,10 @@ workflows:
name
:
proxyd-tests
binary_name
:
proxyd
working_directory
:
proxyd
-
sdk-next-tests
:
name
:
sdk-next-tests
requires
:
-
pnpm-monorepo
-
indexer-tests
:
name
:
indexer-tests<< matrix.fpac >>
matrix
:
...
...
packages/sdk/test-next/README.md
View file @
0832d788
# test-next
-
The new tests for the next version of sdk will use vitest
-
The vitest tests are kept here seperated from mocha tests for now
-
Can find values needed in a
`.env`
file in
`example.env`
To run these tests it is expected that anvil is already running.
See
[
circle config sdk-next tests
](
../../../.circleci/config.yml
)
for which anvil commands you should run
packages/sdk/test-next/bridgeEcoToken.spec.ts
View file @
0832d788
...
...
@@ -58,7 +58,7 @@ const getL2ERC20TokenBalance = async (ownerAddress: Address) => {
)
}
describe
(
'
ECO token
'
,
()
=>
{
describe
.
skip
(
'
ECO token
'
,
()
=>
{
it
(
'
sdk should be able to deposit to l1 bridge contract correctly
'
,
async
()
=>
{
await
l1TestClient
.
impersonateAccount
({
address
:
ECO_WHALE
})
...
...
packages/sdk/test-next/messageStatus.spec.ts
View file @
0832d788
...
...
@@ -11,7 +11,7 @@ const crossChainMessenger = new CrossChainMessenger({
bedrock
:
true
,
})
describe
(
'
getMessageStatus
'
,
()
=>
{
describe
.
skip
(
'
getMessageStatus
'
,
()
=>
{
it
(
`should be able to correctly find a finalized withdrawal`
,
async
()
=>
{
/**
* Tx hash of a withdrawal
...
...
packages/sdk/test-next/proveMessage.spec.ts
View file @
0832d788
...
...
@@ -64,7 +64,7 @@ const crossChainMessenger = new CrossChainMessenger({
bedrock
:
true
,
})
describe
(
'
prove message
'
,
()
=>
{
describe
.
skip
(
'
prove message
'
,
()
=>
{
it
(
`should prove a legacy tx
`
,
async
()
=>
{
/**
...
...
packages/sdk/test-next/testUtils/ethersProviders.ts
View file @
0832d788
import
ethers
from
'
ethers
'
import
{
z
}
from
'
zod
'
/**
* @deprecated
*/
const
E2E_RPC_URL_L1
=
z
.
string
()
.
url
()
.
default
(
'
http://localhost:8545
'
)
.
describe
(
'
L1 ethereum rpc Url
'
)
.
parse
(
import
.
meta
.
env
.
VITE_E2E_RPC_URL_L1
)
/**
* @deprecated
*/
const
E2E_RPC_URL_L2
=
z
.
string
()
.
url
()
.
describe
(
'
L1 ethereum rpc Url
'
)
.
default
(
'
http://localhost:9545
'
)
.
describe
(
'
L2 ethereum rpc Url
'
)
.
parse
(
import
.
meta
.
env
.
VITE_E2E_RPC_URL_L2
)
const
jsonRpcHeaders
=
{
'
User-Agent
'
:
'
eth-optimism/@gateway/backend
'
}
/**
*
Initialize the signer, prover, and cross chain messenger
*
@deprecated
*/
const
l1Provider
=
new
ethers
.
providers
.
JsonRpcProvider
({
export
const
l1Provider
=
new
ethers
.
providers
.
JsonRpcProvider
({
url
:
E2E_RPC_URL_L1
,
headers
:
jsonRpcHeaders
,
})
const
l2Provider
=
new
ethers
.
providers
.
JsonRpcProvider
({
/**
* @deprecated
*/
export
const
l2Provider
=
new
ethers
.
providers
.
JsonRpcProvider
({
url
:
E2E_RPC_URL_L2
,
headers
:
jsonRpcHeaders
,
})
export
{
l1Provider
,
l2Provider
}
export
const
E2E_RPC_URL_SEPOLIA
=
z
.
string
()
.
url
()
.
default
(
'
http://localhost:8545
'
)
.
describe
(
'
SEPOLIA ethereum rpc Url
'
)
.
parse
(
import
.
meta
.
env
.
VITE_E2E_RPC_URL_SEPOLIA
)
export
const
E2E_RPC_URL_OP_SEPOLIA
=
z
.
string
()
.
url
()
.
default
(
'
http://localhost:9545
'
)
.
describe
(
'
OP_SEPOLIA ethereum rpc Url
'
)
.
parse
(
import
.
meta
.
env
.
VITE_E2E_RPC_URL_OP_SEPOLIA
)
export
const
sepoliaProvider
=
new
ethers
.
providers
.
JsonRpcProvider
({
url
:
E2E_RPC_URL_SEPOLIA
,
headers
:
jsonRpcHeaders
,
})
export
const
opSepoliaProvider
=
new
ethers
.
providers
.
JsonRpcProvider
({
url
:
E2E_RPC_URL_OP_SEPOLIA
,
headers
:
jsonRpcHeaders
,
})
packages/sdk/test-next/testUtils/viemClients.ts
View file @
0832d788
...
...
@@ -4,51 +4,108 @@ import {
createWalletClient
,
http
,
}
from
'
viem
'
import
{
goerli
,
optimismGoerli
}
from
'
viem/chains
'
import
{
goerli
,
optimismGoerli
,
optimismSepolia
,
sepolia
}
from
'
viem/chains
'
// we should instead use .env to determine chain so we can support alternate l1/l2 pairs
import
{
E2E_RPC_URL_OP_SEPOLIA
,
E2E_RPC_URL_SEPOLIA
}
from
'
./ethersProviders
'
/**
* @deprecated
*/
const
L1_CHAIN
=
goerli
/**
* @deprecated
*/
const
L2_CHAIN
=
optimismGoerli
/**
* @deprecated
*/
const
L1_RPC_URL
=
'
http://localhost:8545
'
/**
* @deprecated
*/
const
L2_RPC_URL
=
'
http://localhost:9545
'
const
l1TestClient
=
createTestClient
({
/**
* @deprecated
*/
export
const
l1TestClient
=
createTestClient
({
mode
:
'
anvil
'
,
chain
:
L1_CHAIN
,
transport
:
http
(
L1_RPC_URL
),
})
const
l2TestClient
=
createTestClient
({
/**
* @deprecated
*/
export
const
l2TestClient
=
createTestClient
({
mode
:
'
anvil
'
,
chain
:
L2_CHAIN
,
transport
:
http
(
L2_RPC_URL
),
})
const
l1PublicClient
=
createPublicClient
({
/**
* @deprecated
*/
export
const
l1PublicClient
=
createPublicClient
({
chain
:
L1_CHAIN
,
transport
:
http
(
L1_RPC_URL
),
})
const
l2PublicClient
=
createPublicClient
({
/**
* @deprecated
*/
export
const
l2PublicClient
=
createPublicClient
({
chain
:
L2_CHAIN
,
transport
:
http
(
L2_RPC_URL
),
})
const
l1WalletClient
=
createWalletClient
({
/**
* @deprecated
*/
export
const
l1WalletClient
=
createWalletClient
({
chain
:
L1_CHAIN
,
transport
:
http
(
L1_RPC_URL
),
})
const
l2WalletClient
=
createWalletClient
({
/**
* @deprecated
*/
export
const
l2WalletClient
=
createWalletClient
({
chain
:
L2_CHAIN
,
transport
:
http
(
L2_RPC_URL
),
})
export
{
l1TestClient
,
l2TestClient
,
l1PublicClient
,
l2PublicClient
,
l1WalletClient
,
l2WalletClient
,
}
const
SEPOLIA_CHAIN
=
sepolia
const
OP_SEPOLIA_CHAIN
=
optimismSepolia
export
const
sepoliaTestClient
=
createTestClient
({
mode
:
'
anvil
'
,
chain
:
SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_SEPOLIA
),
})
export
const
opSepoliaTestClient
=
createTestClient
({
mode
:
'
anvil
'
,
chain
:
OP_SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_OP_SEPOLIA
),
})
export
const
sepoliaPublicClient
=
createPublicClient
({
chain
:
SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_SEPOLIA
),
})
export
const
opSepoliaPublicClient
=
createPublicClient
({
chain
:
OP_SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_OP_SEPOLIA
),
})
export
const
sepoliaWalletClient
=
createWalletClient
({
chain
:
SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_SEPOLIA
),
})
export
const
opSepoliaWalletClient
=
createWalletClient
({
chain
:
OP_SEPOLIA_CHAIN
,
transport
:
http
(
E2E_RPC_URL_OP_SEPOLIA
),
})
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