fix(gethclient): pass common.Hash to debug_traceTransaction for consistency

Unifies hash argument encoding: TraceTransaction now passes common.Hash directly, matching TraceBlock and other RPC calls.
Leverages common.Hash JSON marshaling (0x‑prefixed hex via MarshalText); no functional change expected.
Aligns with RPC handler signature (tracers.API.TraceBlockByHash(ctx, hash common.Hash, ...)) and existing ethclient usage (e.g., eth_getBlockByHash, eth_getTransactionByHash).
Simplifies code by avoiding unnecessary Hex() conversion and improves consistency/readability.
This commit is contained in:
Fibonacci747 2025-08-12 07:58:31 +02:00 committed by GitHub
parent cbbf686ecc
commit e7e69c53de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,7 +209,7 @@ func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- co
// 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 result any var result any
err := ec.c.CallContext(ctx, &result, "debug_traceTransaction", hash.Hex(), config) err := ec.c.CallContext(ctx, &result, "debug_traceTransaction", hash, config)
if err != nil { if err != nil {
return nil, err return nil, err
} }