aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-05-09 20:24:25 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-09 20:24:25 +0800
commit7beccb29becf439df7bf4c033a94c019ad25bead (patch)
tree5d8581c15f3f110c765c6383e0c4c7724418d6f0 /tests
parent5dbd8b42a90779bd4269012c1336679fd4ca9824 (diff)
downloadgo-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.gz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.bz2
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.lz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.xz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.zst
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/block_test_util.go2
-rw-r--r--tests/state_test_util.go3
-rw-r--r--tests/vm_test_util.go3
3 files changed, 3 insertions, 5 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index 579e783b1..a72799f6e 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -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
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 3b761bd77..84581fae1 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -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)
diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go
index b365167a6..cb81c5b94 100644
--- a/tests/vm_test_util.go
+++ b/tests/vm_test_util.go
@@ -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 {