forked from OffchainLabs/nitro-testnode
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsmoke-test.bash
More file actions
executable file
·26 lines (20 loc) · 945 Bytes
/
smoke-test.bash
File metadata and controls
executable file
·26 lines (20 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -euo pipefail
source ./regression-tests/common.bash
./test-node.bash --espresso $(get_espresso_image_flag) --validate --tokenbridge --init-force --detach
rollupAddress=$(docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'")
previousConfirmed=$(cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(bytes32)')
echo "latest confirmed hash: $previousConfirmed"
# Sending L2 transaction
./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait
while true; do
confirmed=$(cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(bytes32)')
if [ -n "$confirmed" ] && [ "$confirmed" != "$previousConfirmed" ]; then
echo "✅ Confirmation observed ...$confirmed"
break
else
echo "Waiting for more confirmed nodes ...$confirmed"
fi
sleep 5
done
docker compose down