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.
This commit is contained in:
Felix Lange
2017-08-10 11:38:17 +02:00
parent 17ce0a37de
commit 6a56b15019
6 changed files with 111 additions and 85 deletions

View File

@ -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)