From 037754a177ba439479fd5248fa7620672d3d9908 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:30:33 +0100 Subject: [PATCH] rpc: add `txHash` to `debug_traceBlock*` results (#9016) See https://github.com/ethereum/go-ethereum/pull/27183 --- turbo/jsonrpc/gen_traces_test.go | 1 + turbo/jsonrpc/tracing.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/turbo/jsonrpc/gen_traces_test.go b/turbo/jsonrpc/gen_traces_test.go index 85b90bb5a00..a5f4c7bdc7a 100644 --- a/turbo/jsonrpc/gen_traces_test.go +++ b/turbo/jsonrpc/gen_traces_test.go @@ -49,6 +49,7 @@ func TestGeneratedDebugApi(t *testing.T) { expectedJSON := ` [ { + "txHash": "0xb42edc1d46932ef34be0ba49402dc94e3d2319c066f02945f6828cd344fcfa7b", "result": { "calls": [ { diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index 6a0c1c755d6..bdf129af64c 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -111,6 +111,9 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp for idx, txn := range txns { stream.WriteObjectStart() + stream.WriteObjectField("txHash") + stream.WriteString(txn.Hash().Hex()) + stream.WriteMore() stream.WriteObjectField("result") select { default: