From 1f3596c25af077a3303c554ee6b49404b20f7117 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Fri, 1 Apr 2016 00:30:21 +0200 Subject: 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 --- eth/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'eth/api.go') 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. -- cgit v1.2.3