aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-11 20:23:22 +0800
committerGitHub <noreply@github.com>2017-08-11 20:23:22 +0800
commit6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f (patch)
tree7b0570a6131a59e298df8eb2fbefedd520575b0e /tests/block_test_util.go
parent833eeb9f23e6808377f0414f0db4a731b134fe9f (diff)
parent6a56b15019271f5a16406c7e1be50d581f8efcab (diff)
downloaddexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar.gz
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar.bz2
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar.lz
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar.xz
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.tar.zst
dexon-6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f.zip
Merge pull request #14964 from fjl/tests-update-2
tests: update tests, use blockchain test "network" field
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)