From 84b25000a4af560eab85ea3f90f427c060319939 Mon Sep 17 00:00:00 2001 From: vitaliy <vitaliy.bashlak@ideasoft.io> Date: Wed, 25 Sep 2024 18:49:16 +0300 Subject: [PATCH] Fix debug_traceBlockByNumber to use hex --- packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go | 2 +- packages/evm/jsonrpc/service.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go b/packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go index 9ad48a584c..335f7d8120 100644 --- a/packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go +++ b/packages/evm/jsonrpc/jsonrpctest/jsonrpc_test.go @@ -688,7 +688,7 @@ func TestRPCTraceBlock(t *testing.T) { context.Background(), &res1, "debug_traceBlockByNumber", - env.BlockNumber(), + hexutil.Uint64(env.BlockNumber()).String(), tracers.TraceConfig{TracerConfig: []byte(`{"tracer": "callTracer"}`)}, ) require.NoError(t, err) diff --git a/packages/evm/jsonrpc/service.go b/packages/evm/jsonrpc/service.go index 7594fbb3e8..1174e2d04c 100644 --- a/packages/evm/jsonrpc/service.go +++ b/packages/evm/jsonrpc/service.go @@ -554,9 +554,9 @@ func (d *DebugService) TraceTransaction(txHash common.Hash, config *tracers.Trac }) } -func (d *DebugService) TraceBlockByNumber(blockNumber uint64, config *tracers.TraceConfig) (interface{}, error) { +func (d *DebugService) TraceBlockByNumber(blockNumber hexutil.Uint64, config *tracers.TraceConfig) (interface{}, error) { return withMetrics(d.metrics, "debug_traceBlockByNumber", func() (interface{}, error) { - return d.evmChain.TraceBlockByNumber(blockNumber, config) + return d.evmChain.TraceBlockByNumber(uint64(blockNumber), config) }) }