forked from ethereum/execution-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
b2t.sh
executable file
·29 lines (23 loc) · 809 Bytes
/
b2t.sh
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
27
28
#!/bin/sh
# Translate BlockchainTests into t8n format.
#
# Note: t8n requires that hex values not have leading 0s, so you'll need to
# trim the manually (for now) :(.
set -euf
if [ "$#" -ne 2 ]; then
echo "Usage: debug.sh [test_path] [test_name]"
exit
fi
jq --arg testname "${2}" '.[$testname] |
.alloc = .pre | del(.pre) |
.txs = .blocks[0].transactions |
.env = .genesisBlockHeader |
.env = {
currentCoinbase: .env.coinbase,
currentDifficulty: .env.difficulty,
currentGasLimit: .env.gasLimit,
currentNumber: .env.number,
currentTimestamp: .env.timestamp
} |
{alloc: .alloc, env: .env, txs: .txs }' ${1}
# evm t8n --input.alloc=stdin --input.env=stdin --input.txs=stdin --output.result=stdout --output.alloc=stdout