From 6a56b15019271f5a16406c7e1be50d581f8efcab Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 10 Aug 2017 11:38:17 +0200 Subject: tests: update tests, use blockchain test "network" field Blockchain tests now include the "network" which determines the chain config to use. Remove config matching based on test name and share the name-to-config index with state tests. Byzantium/Constantinople tests are still skipped because most of them fail anyway. --- tests/block_test_util.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/block_test_util.go') 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) -- cgit v1.2.3