|
|
|
@ -773,7 +773,7 @@ func (self *XEth) PushTx(encodedTx string) (string, error) { |
|
|
|
|
return tx.Hash().Hex(), nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, error) { |
|
|
|
|
func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, string, error) { |
|
|
|
|
statedb := self.State().State() //self.eth.ChainManager().TransState()
|
|
|
|
|
var from *state.StateObject |
|
|
|
|
if len(fromStr) == 0 { |
|
|
|
@ -807,8 +807,10 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st |
|
|
|
|
block := self.CurrentBlock() |
|
|
|
|
vmenv := core.NewEnv(statedb, self.backend.ChainManager(), msg, block) |
|
|
|
|
|
|
|
|
|
initialGas := new(big.Int).Set(msg.gas) |
|
|
|
|
res, err := vmenv.Call(msg.from, msg.to, msg.data, msg.gas, msg.gasPrice, msg.value) |
|
|
|
|
return common.ToHex(res), err |
|
|
|
|
|
|
|
|
|
return common.ToHex(res), initialGas.Sub(initialGas, msg.gas).String(), err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (self *XEth) ConfirmTransaction(tx string) bool { |
|
|
|
|