aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethereum/blocktest.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-03-20 16:10:13 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-03-23 23:32:20 +0800
commit08bb472c913a2b4cf0838785616b1ec7712d0b00 (patch)
tree713577a7092c2aa6d5fba5808dbbe5b290e86490 /cmd/ethereum/blocktest.go
parent33c5186fd06d890e590b18cc6f8479070c2e51e8 (diff)
downloaddexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar.gz
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar.bz2
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar.lz
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar.xz
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.tar.zst
dexon-08bb472c913a2b4cf0838785616b1ec7712d0b00.zip
Add validation of post state accounts to block tests
Diffstat (limited to 'cmd/ethereum/blocktest.go')
-rw-r--r--cmd/ethereum/blocktest.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/ethereum/blocktest.go b/cmd/ethereum/blocktest.go
index f2014acfd..b75518138 100644
--- a/cmd/ethereum/blocktest.go
+++ b/cmd/ethereum/blocktest.go
@@ -52,7 +52,8 @@ func runblocktest(ctx *cli.Context) {
ethereum.ResetWithGenesisBlock(test.Genesis)
// import pre accounts
- if err := test.InsertPreState(ethereum.StateDb()); err != nil {
+ statedb, err := test.InsertPreState(ethereum.StateDb())
+ if err != nil {
utils.Fatalf("could not insert genesis accounts: %v", err)
}
@@ -61,8 +62,14 @@ func runblocktest(ctx *cli.Context) {
if err := chain.InsertChain(test.Blocks); err != nil {
utils.Fatalf("Block Test load error: %v", err)
} else {
- fmt.Println("Block Test chain loaded, starting ethereum.")
+ fmt.Println("Block Test chain loaded")
+ }
+
+ if err := test.ValidatePostState(statedb); err != nil {
+ utils.Fatalf("post state validation failed: %v", err)
}
+ fmt.Println("Block Test post state validated, starting ethereum.")
+
if startrpc == "rpc" {
startEth(ctx, ethereum)
utils.StartRPC(ethereum, ctx)