aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethtest
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 /cmd/ethtest
parent032ab665299d75bffc25260e8fa477ace19db06a (diff)
downloaddexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.bz2
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.lz
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.xz
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst
dexon-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip
Refactored ethutil.Config.Db out
Diffstat (limited to 'cmd/ethtest')
-rw-r--r--cmd/ethtest/main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go
index 05e99564c..7d1c3de01 100644
--- a/cmd/ethtest/main.go
+++ b/cmd/ethtest/main.go
@@ -29,6 +29,7 @@ import (
"os"
"strings"
+ "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
@@ -41,8 +42,8 @@ type Account struct {
Storage map[string]string
}
-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) {
@@ -74,9 +75,10 @@ func RunVmTest(js string) (failed int) {
}
for name, test := range tests {
- state := state.New(helper.NewTrie())
+ db, _ := ethdb.NewMemDatabase()
+ state := state.New(nil, db)
for addr, account := range test.Pre {
- obj := StateObjectFromAccount(addr, account)
+ obj := StateObjectFromAccount(db, addr, account)
state.SetStateObject(obj)
}