Skip to content

Commit 815c4fb

Browse files
chore: Add a stub of an E2E test
1 parent fe19560 commit 815c4fb

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ethereum_package:
2+
participants:
3+
- el_type: reth
4+
cl_type: lighthouse
5+
optimism_package:
6+
op_contract_deployer_params:
7+
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.11
8+
chains:
9+
- network_params:
10+
isthmus_time_offset: 0
11+
participants:
12+
- el_type: op-geth
13+
el_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:latest
14+
cl_type: op-node
15+
cl_image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop
16+
cl_extra_params:
17+
- "--l1.trustrpc=true"
18+
batcher_params:
19+
extra_params:
20+
- "--throttle-interval=0"

test/e2e/tests/isthmus.bats

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
setup() {
2+
load "../lib/bats-support/load.bash"
3+
load "../lib/bats-assert/load.bash"
4+
}
5+
6+
teardown() {
7+
8+
}
9+
10+
@test "should have isthmus time if isthmus_time_offset is configured" {
11+
local ENCLAVE_ID=op-isthmus--001
12+
13+
# First we start the enclave
14+
run kurtosis run --enclave $ENCLAVE_ID . --args-file test/e2e/tests/assets/kurtosis_args_isthmus.yaml
15+
assert_success
16+
17+
# We get the UUID of the op-geth service
18+
local OP_GETH_SERVICE_UUID=$(kurtosis enclave inspect $ENCLAVE_ID --full-uuids| grep op-el-1-op-geth-op-node-op-kurtosis | awk '{print $1;}')
19+
assert [ -n "$OP_GETH_SERVICE_UUID" ]
20+
21+
# Now we find its RPC URL
22+
local OP_GETH_RPC_URL=$(kurtosis service inspect $ENCLAVE_ID $OP_GETH_SERVICE_UUID | grep ' rpc:' | awk '{print $4;}')
23+
assert [ -n "$OP_GETH_RPC_URL" ]
24+
25+
# We ask the RPC for the node info
26+
local OP_GETH_NODE_INFO_JSON=$(curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' $OP_GETH_RPC_URL)
27+
28+
# And finally we find the isthmusTime and make sure it's defined
29+
local OP_GETH_ISTHMUS_TIME=$(jq '.result.protocols.eth.config.isthmusTime' <<< $OP_GETH_NODE_INFO_JSON)
30+
assert_equal "$OP_GETH_ISTHMUS_TIME" "0"
31+
32+
kurtosis enclave rm -f $ENCLAVE_ID
33+
}

0 commit comments

Comments
 (0)