diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
commit | fed3e6a808921fb8274b50043c5c39a24a1bbccf (patch) | |
tree | d632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /xeth | |
parent | 032ab665299d75bffc25260e8fa477ace19db06a (diff) | |
download | dexon-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 'xeth')
-rw-r--r-- | xeth/js_types.go | 6 | ||||
-rw-r--r-- | xeth/world.go | 2 | ||||
-rw-r--r-- | xeth/xeth.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/xeth/js_types.go b/xeth/js_types.go index e7a1e95e9..5fe5946b1 100644 --- a/xeth/js_types.go +++ b/xeth/js_types.go @@ -39,7 +39,7 @@ func NewJSBlock(block *types.Block) *JSBlock { ptxs := make([]*JSTransaction, len(block.Transactions())) for i, tx := range block.Transactions() { - ptxs[i] = NewJSTx(tx, block.State()) + ptxs[i] = NewJSTx(tx) } txlist := ethutil.NewList(ptxs) @@ -76,7 +76,7 @@ func (self *JSBlock) GetTransaction(hash string) *JSTransaction { return nil } - return NewJSTx(tx, self.ref.State()) + return NewJSTx(tx) } type JSTransaction struct { @@ -95,7 +95,7 @@ type JSTransaction struct { Confirmations int `json:"confirmations"` } -func NewJSTx(tx *types.Transaction, state *state.StateDB) *JSTransaction { +func NewJSTx(tx *types.Transaction) *JSTransaction { hash := ethutil.Bytes2Hex(tx.Hash()) receiver := ethutil.Bytes2Hex(tx.To()) if receiver == "0000000000000000000000000000000000000000" { diff --git a/xeth/world.go b/xeth/world.go index 008a08423..25c2f3eb8 100644 --- a/xeth/world.go +++ b/xeth/world.go @@ -36,7 +36,7 @@ func (self *World) SafeGet(addr []byte) *Object { func (self *World) safeGet(addr []byte) *state.StateObject { object := self.State().GetStateObject(addr) if object == nil { - object = state.NewStateObject(addr) + object = state.NewStateObject(addr, self.pipe.obj.Db()) } return object diff --git a/xeth/xeth.go b/xeth/xeth.go index a10ccfc8b..34d8ffd0a 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -81,7 +81,7 @@ func (self *XEth) Execute(addr []byte, data []byte, value, gas, price *ethutil.V func (self *XEth) ExecuteObject(object *Object, data []byte, value, gas, price *ethutil.Value) ([]byte, error) { var ( - initiator = state.NewStateObject(self.obj.KeyManager().KeyPair().Address()) + initiator = state.NewStateObject(self.obj.KeyManager().KeyPair().Address(), self.obj.Db()) block = self.chainManager.CurrentBlock() ) |