aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
committerobscuren <geffobscura@gmail.com>2015-01-07 20:17:48 +0800
commitfed3e6a808921fb8274b50043c5c39a24a1bbccf (patch)
treed632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /tests/vm
parent032ab665299d75bffc25260e8fa477ace19db06a (diff)
downloadgo-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.bz2
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.lz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.xz
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst
go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip
Refactored ethutil.Config.Db out
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/gh_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/vm/gh_test.go b/tests/vm/gh_test.go
index 698b0aefc..2aece215e 100644
--- a/tests/vm/gh_test.go
+++ b/tests/vm/gh_test.go
@@ -7,6 +7,7 @@ import (
"testing"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/state"
@@ -38,8 +39,8 @@ func (self Log) Topics() [][]byte {
return t
}
-func StateObjectFromAccount(addr string, account Account) *state.StateObject {
- obj := state.NewStateObject(ethutil.Hex2Bytes(addr))
+func StateObjectFromAccount(db ethutil.Database, addr string, account Account) *state.StateObject {
+ obj := state.NewStateObject(ethutil.Hex2Bytes(addr), db)
obj.SetBalance(ethutil.Big(account.Balance))
if ethutil.IsHex(account.Code) {
@@ -84,9 +85,10 @@ func RunVmTest(p string, t *testing.T) {
continue
}
*/
- statedb := state.New(helper.NewTrie())
+ db, _ := ethdb.NewMemDatabase()
+ statedb := state.New(nil, db)
for addr, account := range test.Pre {
- obj := StateObjectFromAccount(addr, account)
+ obj := StateObjectFromAccount(db, addr, account)
statedb.SetStateObject(obj)
for a, v := range account.Storage {
obj.SetState(helper.FromHex(a), ethutil.NewValue(helper.FromHex(v)))