From 0d73c8f807efbac8e4160c803c8fb3e9ac50961b Mon Sep 17 00:00:00 2001 From: bbaktaeho Date: Wed, 9 Apr 2025 17:43:13 +0900 Subject: [PATCH] fix: add txHash to historical trace results --- eth/tracers/api.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 574ccb60de..477eae9eb0 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -455,6 +455,9 @@ func (api *API) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, if err != nil { return nil, fmt.Errorf("historical backend error: %w", err) } + for i, tx := range block.Transactions() { + histResult[i].TxHash = tx.Hash() + } return histResult, nil } else { return nil, rpc.ErrNoHistoricalFallback @@ -479,6 +482,9 @@ func (api *API) TraceBlockByHash(ctx context.Context, hash common.Hash, config * if err != nil { return nil, fmt.Errorf("historical backend error: %w", err) } + for i, tx := range block.Transactions() { + histResult[i].TxHash = tx.Hash() + } return histResult, nil } else { return nil, rpc.ErrNoHistoricalFallback