This commit is contained in:
Roy Crihfield 2024-07-24 16:38:09 +08:00
parent 43ccaba4b8
commit 8b402c11d0
2 changed files with 5 additions and 8 deletions

View File

@ -41,10 +41,6 @@ jobs:
go-version-file: 'go.mod' go-version-file: 'go.mod'
check-latest: true check-latest: true
- name: Install jq
env:
DEBIAN_FRONTEND: noninteractive
run: apt-get update && apt-get install -y jq
# At present the stock setup-python action fails on Linux/aarch64 # At present the stock setup-python action fails on Linux/aarch64
# Conditional steps below workaroud this by using deadsnakes for that case only # Conditional steps below workaroud this by using deadsnakes for that case only
- name: "Install Python for ARM on Linux" - name: "Install Python for ARM on Linux"
@ -82,13 +78,13 @@ jobs:
- name: Wait for testnet - name: Wait for testnet
run: | run: |
# Start validator at current head, but not before Merge (block 1 on test chain) # Start validator at current head, but not before Merge (block 1 on test chain)
echo "Waiting for chain head to progress..."
while while
echo "Waiting for chain head to progress..."
height=$(./scripts/get-block-number.sh $ETH_HTTP_PATH) height=$(./scripts/get-block-number.sh $ETH_HTTP_PATH)
[[ "$height" < 2 ]]; [[ "$height" -lt 2 ]];
do sleep 5; done do sleep 5; done
echo "Chain has reached block $height" echo "Chain has reached block $height"
echo VALIDATE_FROM_BLOCK=$height >> "$GITHUB_ENV" echo VALIDATE_FROM_BLOCK=$height >> "$GITHUB_ENV"
- name: Run tests - name: Run tests
run: | run: |
go test ./integration/... -v -timeout=20m go test -v -p 1 ./integration/... -timeout=20m

View File

@ -6,6 +6,7 @@ geth_endpoint="${1:-$ETH_HTTP_PATH}"
latest_block_hex=$(curl -s $geth_endpoint -X POST -H "Content-Type: application/json" \ latest_block_hex=$(curl -s $geth_endpoint -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":42}' | \ --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":42}' | \
jq -r .result) python3 -c 'import json, sys; print(int(json.load(sys.stdin)["result"], 16))' \
)
printf "%d" $latest_block_hex printf "%d" $latest_block_hex