Skip to content

Commit

Permalink
Add debug_traceBlockByHash test
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy committed Sep 10, 2024
1 parent 8351049 commit 237db99
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,19 @@ func TestRPCTraceBlock(t *testing.T) {
)
require.NoError(t, err)

var res2 json.RawMessage
// we have to use the raw client, because the normal client does not support debug methods
err = env.RawClient.CallContext(
context.Background(),
&res2,
"debug_traceBlockByHash",
env.BlockByNumber(big.NewInt(int64(env.BlockNumber()))).Hash(),
tracers.TraceConfig{TracerConfig: []byte(`{"tracer": "callTracer"}`)},
)
require.NoError(t, err)

require.Equal(t, res1, res2, "debug_traceBlockByNumber and debug_traceBlockByNumber should produce equal results")

traceBlock := make([]jsonrpc.TxTraceResult, 0)
err = json.Unmarshal(res1, &traceBlock)
require.NoError(t, err)
Expand Down

0 comments on commit 237db99

Please sign in to comment.