From e7e69c53de53d4c91be46d1e4a911701c8a80bb7 Mon Sep 17 00:00:00 2001 From: Fibonacci747 Date: Tue, 12 Aug 2025 07:58:31 +0200 Subject: [PATCH] fix(gethclient): pass common.Hash to debug_traceTransaction for consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- ethclient/gethclient/gethclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethclient/gethclient/gethclient.go b/ethclient/gethclient/gethclient.go index d030878e546..54997cbf51a 100644 --- a/ethclient/gethclient/gethclient.go +++ b/ethclient/gethclient/gethclient.go @@ -209,7 +209,7 @@ func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- co // and returns them as a JSON object. func (ec *Client) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig) (any, error) { 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 { return nil, err }