aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r--tests/block_test_util.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index a74f7d68d..c1d433ff3 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -53,6 +53,7 @@ type btJSON struct {
Pre core.GenesisAlloc `json:"pre"`
Post core.GenesisAlloc `json:"postState"`
BestBlock common.UnprefixedHash `json:"lastblockhash"`
+ Network string `json:"network"`
}
type btBlock struct {
@@ -91,7 +92,12 @@ type btHeaderMarshaling struct {
Timestamp *math.HexOrDecimal256
}
-func (t *BlockTest) Run(config *params.ChainConfig) error {
+func (t *BlockTest) Run() error {
+ config, ok := Forks[t.json.Network]
+ if !ok {
+ return UnsupportedForkError{t.json.Network}
+ }
+
// import pre accounts & construct test genesis block & state root
db, _ := ethdb.NewMemDatabase()
gblock, err := t.genesis(config).Commit(db)