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:
@ -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)
|
||||
|
Reference in New Issue
Block a user