Refactored ethutil.Config.Db out
This commit is contained in:
@ -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" {
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user