Skip to content

Commit

Permalink
[api]Support for tracer and tracerConfig in debug_traceTransaction API (
Browse files Browse the repository at this point in the history
#4216)

Co-authored-by: dustinxie <dahuaxie@gmail.com>
  • Loading branch information
millken and dustinxie committed Apr 17, 2024
1 parent 7cf65d9 commit ecb2faf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/web3server.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,13 @@ func (svr *web3Handler) traceTransaction(ctx context.Context, in *gjson.Result)
EnableReturnData: enableReturnData,
},
}
if tracer := options.Get("tracer"); tracer.Exists() {
cfg.Tracer = new(string)
*cfg.Tracer = tracer.String()
if tracerConfig := options.Get("tracerConfig"); tracerConfig.Exists() {
cfg.TracerConfig = json.RawMessage(tracerConfig.Raw)
}
}
retval, receipt, tracer, err := svr.coreService.TraceTransaction(ctx, actHash.String(), cfg)
if err != nil {
return nil, err
Expand Down

0 comments on commit ecb2faf

Please sign in to comment.