aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2016-04-01 06:30:21 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2016-04-01 07:01:10 +0800
commit1f3596c25af077a3303c554ee6b49404b20f7117 (patch)
tree33d4c6a96eed3bf1ce9f69bbef3cbc1561f2b114 /eth
parent9055c16efad80d0c69992e7992083f967733aa9c (diff)
downloadgo-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar.gz
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar.bz2
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar.lz
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar.xz
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.tar.zst
go-tangerine-1f3596c25af077a3303c554ee6b49404b20f7117.zip
core: transition db now also returns the required gas amount
Exposes some core methods to transition and compute new state information and adds an additional return value to the transition db method to fetch required gas for that particular message (excluding gas refunds from any SSTORE[X] = 0 and SUICIDE. Fixes #2395
Diffstat (limited to 'eth')
-rw-r--r--eth/api.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/eth/api.go b/eth/api.go
index 06c10daa9..af03c096d 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -674,11 +674,11 @@ func (s *PublicBlockChainAPI) doCall(args CallArgs, blockNr rpc.BlockNumber) (st
vmenv := core.NewEnv(stateDb, s.config, s.bc, msg, block.Header(), s.config.VmConfig)
gp := new(core.GasPool).AddGas(common.MaxBig)
- res, gas, err := core.ApplyMessage(vmenv, msg, gp)
+ res, requiredGas, _, err := core.NewStateTransition(vmenv, msg, gp).TransitionDb()
if len(res) == 0 { // backwards compatibility
- return "0x", gas, err
+ return "0x", requiredGas, err
}
- return common.ToHex(res), gas, err
+ return common.ToHex(res), requiredGas, err
}
// Call executes the given transaction on the state for the given block number.