aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-08-10 17:38:17 +0800
committerFelix Lange <fjl@twurst.com>2017-08-11 18:34:03 +0800
commit6a56b15019271f5a16406c7e1be50d581f8efcab (patch)
tree55974ff01bbb8c9a4e554f9f647f6c8c69006a84 /tests/block_test_util.go
parent17ce0a37de5a2712a8bf9d58df705e718b3b2cd6 (diff)
downloadgo-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar.gz
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar.bz2
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar.lz
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar.xz
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.tar.zst
go-tangerine-6a56b15019271f5a16406c7e1be50d581f8efcab.zip
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.
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)