aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/blocktestcmd.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/blocktestcmd.go')
-rw-r--r--cmd/geth/blocktestcmd.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/geth/blocktestcmd.go b/cmd/geth/blocktestcmd.go
index e0a5becdc..e4d97aa53 100644
--- a/cmd/geth/blocktestcmd.go
+++ b/cmd/geth/blocktestcmd.go
@@ -101,7 +101,8 @@ func runBlockTest(ctx *cli.Context) {
func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, error) {
cfg := utils.MakeEthConfig(ClientIdentifier, Version, ctx)
- cfg.NewDB = func(path string) (ethdb.Database, error) { return ethdb.NewMemDatabase() }
+ db, _ := ethdb.NewMemDatabase()
+ cfg.NewDB = func(path string) (ethdb.Database, error) { return db, nil }
cfg.MaxPeers = 0 // disable network
cfg.Shh = false // disable whisper
cfg.NAT = nil // disable port mapping
@@ -113,7 +114,7 @@ func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, er
// import the genesis block
ethereum.ResetWithGenesisBlock(test.Genesis)
// import pre accounts
- _, err = test.InsertPreState(ethereum)
+ _, err = test.InsertPreState(db, cfg.AccountManager)
if err != nil {
return ethereum, fmt.Errorf("InsertPreState: %v", err)
}
@@ -123,7 +124,10 @@ func runOneBlockTest(ctx *cli.Context, test *tests.BlockTest) (*eth.Ethereum, er
if err != nil {
return ethereum, fmt.Errorf("Block Test load error: %v", err)
}
- newDB := cm.State()
+ newDB, err := cm.State()
+ if err != nil {
+ return ethereum, fmt.Errorf("Block Test get state error: %v", err)
+ }
if err := test.ValidatePostState(newDB); err != nil {
return ethereum, fmt.Errorf("post state validation failed: %v", err)
}