diff options
author | obscuren <geffobscura@gmail.com> | 2015-05-12 21:53:00 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-05-12 21:53:00 +0800 |
commit | ff99752dddb75779f7a82b27f578fe77bc46fdc9 (patch) | |
tree | b17090157f209094486fdf7e2b769acbf62bff90 /xeth | |
parent | 260536a729337e47646d6d72d19d2095b6d71f4c (diff) | |
download | dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar.gz dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar.bz2 dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar.lz dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar.xz dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.tar.zst dexon-ff99752dddb75779f7a82b27f578fe77bc46fdc9.zip |
xeth: use same semantics as block processer for transient calls
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/xeth.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 1ddd4c6e4..11dc506b8 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -787,6 +787,7 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st from = statedb.GetOrNewStateObject(common.HexToAddress(fromStr)) } + from.SetGasPool(self.backend.ChainManager().GasLimit()) msg := callmsg{ from: from, to: common.HexToAddress(toStr), @@ -807,10 +808,8 @@ 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), initialGas.Sub(initialGas, msg.gas).String(), err + res, gas, err := core.ApplyMessage(vmenv, msg, from) + return common.ToHex(res), gas.String(), err } func (self *XEth) ConfirmTransaction(tx string) bool { |