ethclient/gethclient: address comment

This commit is contained in:
Gary Rong 2025-02-28 20:00:57 +08:00
parent a1d4fbc90b
commit 2b24a166df
1 changed files with 2 additions and 9 deletions

View File

@ -208,15 +208,8 @@ func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- co
// TraceTransaction returns the structured logs created during the execution of EVM // TraceTransaction returns the structured logs created during the execution of EVM
// and returns them as a JSON object. // and returns them as a JSON object.
func (ec *Client) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (any, error) { func (ec *Client) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (any, error) {
var ( var result any
err error err := ec.c.CallContext(ctx, &result, "debug_traceTransaction", hash.Hex(), config)
result any
)
if config != nil {
err = ec.c.CallContext(ctx, &result, "debug_traceTransaction", hash.Hex(), config)
} else {
err = ec.c.CallContext(ctx, &result, "debug_traceTransaction", hash.Hex())
}
if err != nil { if err != nil {
return nil, err return nil, err
} }