diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-09-19 07:34:54 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-09-19 07:34:54 +0800 |
commit | e40b447fead5ec3c4ccb133418431ea25be3c545 (patch) | |
tree | e0f46603015362e16e58c6381272ca2cca8b1641 /cmd | |
parent | b94b9b0158ed2549eb025aad3da63c3cf2015a51 (diff) | |
parent | 47ca6904b326165e394859f15bd2c374f7351847 (diff) | |
download | dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar.gz dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar.bz2 dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar.lz dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar.xz dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.tar.zst dexon-e40b447fead5ec3c4ccb133418431ea25be3c545.zip |
Merge pull request #1814 from Gustav-Simonsson/common_tests
tests: update common test wrappers and test files
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/blocktestcmd.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd/geth/blocktestcmd.go b/cmd/geth/blocktestcmd.go index a667cfd60..d3257ca4d 100644 --- a/cmd/geth/blocktestcmd.go +++ b/cmd/geth/blocktestcmd.go @@ -111,25 +111,27 @@ func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, er if err != nil { return nil, err } - // if err := ethereum.Start(); err != nil { - // return nil, err - // } // import the genesis block ethereum.ResetWithGenesisBlock(test.Genesis) // import pre accounts - statedb, err := test.InsertPreState(ethereum) + _, err = test.InsertPreState(ethereum) if err != nil { return ethereum, fmt.Errorf("InsertPreState: %v", err) } - if err := test.TryBlocksInsert(ethereum.ChainManager()); err != nil { + cm := ethereum.ChainManager() + + validBlocks, err := test.TryBlocksInsert(cm) + if err != nil { return ethereum, fmt.Errorf("Block Test load error: %v", err) } - if err := test.ValidatePostState(statedb); err != nil { + newDB := cm.State() + if err := test.ValidatePostState(newDB); err != nil { return ethereum, fmt.Errorf("post state validation failed: %v", err) } - return ethereum, nil + + return ethereum, test.ValidateImportedHeaders(cm, validBlocks) } |