TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.
(ctx context.Context, hash common.Hash, config *TraceConfig)
| 569 | // TraceTransaction returns the structured logs created during the execution of EVM |
| 570 | // and returns them as a JSON object. |
| 571 | func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) { |
| 572 | // Retrieve the transaction and assemble its EVM context |
| 573 | tx, blockHash, _, index := rawdb.ReadTransaction(api.cpc.ChainDb(), hash) |
| 574 | if tx == nil { |
| 575 | return nil, fmt.Errorf("transaction %x not found", hash) |
| 576 | } |
| 577 | reexec := defaultTraceReexec |
| 578 | if config != nil && config.Reexec != nil { |
| 579 | reexec = *config.Reexec |
| 580 | } |
| 581 | msg, vmctx, statedb, err := api.computeTxEnv(blockHash, int(index), reexec) |
| 582 | if err != nil { |
| 583 | return nil, err |
| 584 | } |
| 585 | // Trace the transaction and return |
| 586 | return api.traceTx(ctx, msg, vmctx, statedb, config) |
| 587 | } |
| 588 | |
| 589 | // traceTx configures a new tracer according to the provided configuration, and |
| 590 | // executes the given message in the provided environment. The return value will |
nothing calls this directly
no test coverage detected