all: get rid of error when creating memory database (#16716)

* all: get rid of error when create mdb

* core: clean up variables definition

* all: inline mdb definition
This commit is contained in:
gary rong authored and Péter Szilágyi committed 2018-05-09 15:24:25 +03:00
1 parent 5dbd8b42a9
commit 7beccb29be
48 files changed
+172 -230

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ func (t *BlockTest) Run() error {
}
// import pre accounts & construct test genesis block & state root
db, _ := ethdb.NewMemDatabase()
db := ethdb.NewMemDatabase()
gblock, err := t.genesis(config).Commit(db)
if err != nil {
return err
+1 -2
View File
@@ -126,8 +126,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD
return nil, UnsupportedForkError{subtest.Fork}
}
block := t.genesis(config).ToBlock(nil)
db, _ := ethdb.NewMemDatabase()
statedb := MakePreState(db, t.json.Pre)
statedb := MakePreState(ethdb.NewMemDatabase(), t.json.Pre)
post := t.json.Post[subtest.Fork][subtest.Index]
msg, err := t.json.Tx.toMessage(post)
+1 -2
View File
@@ -79,8 +79,7 @@ type vmExecMarshaling struct {
}
func (t *VMTest) Run(vmconfig vm.Config) error {
db, _ := ethdb.NewMemDatabase()
statedb := MakePreState(db, t.json.Pre)
statedb := MakePreState(ethdb.NewMemDatabase(), t.json.Pre)
ret, gasRemaining, err := t.exec(statedb, vmconfig)
if t.json.GasRemaining == nil {