diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-10-02 21:23:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 21:23:21 +0800 |
commit | f4c49bc0f03910f0caa16c4a067c0f201de293b7 (patch) | |
tree | af3a734392c524662d3f2fc63be3f926f10793b7 /eth/api.go | |
parent | d3476562805a5b1026d91f0d954596e57e9de483 (diff) | |
parent | 94903d572b4ee72c7ea62ce9856f51def85fdd2a (diff) | |
download | go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar.gz go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar.bz2 go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar.lz go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar.xz go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.tar.zst go-tangerine-f4c49bc0f03910f0caa16c4a067c0f201de293b7.zip |
Merge pull request #15030 from rjl493456442/expose_vm_failed
internal, accounts, eth: utilize vm failed flag to help gas estimation
Diffstat (limited to 'eth/api.go')
-rw-r--r-- | eth/api.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/api.go b/eth/api.go index d64e4e6c7..e91f51bb9 100644 --- a/eth/api.go +++ b/eth/api.go @@ -523,8 +523,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common. // Run the transaction with tracing enabled. vmenv := vm.NewEVM(context, statedb, api.config, vm.Config{Debug: true, Tracer: tracer}) - // TODO utilize failed flag - ret, gas, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())) + ret, gas, failed, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())) if err != nil { return nil, fmt.Errorf("tracing failed: %v", err) } @@ -532,6 +531,7 @@ func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, txHash common. case *vm.StructLogger: return ðapi.ExecutionResult{ Gas: gas, + Failed: failed, ReturnValue: fmt.Sprintf("%x", ret), StructLogs: ethapi.FormatLogs(tracer.StructLogs()), }, nil |