From b2023ab1102c07f7e858bd69534fa7f685e4bebc Mon Sep 17 00:00:00 2001 From: ucwong Date: Sat, 27 Jul 2024 21:17:01 +0800 Subject: [PATCH] hex encode --- rpc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc.go b/rpc.go index 8317799..6fc9a0b 100644 --- a/rpc.go +++ b/rpc.go @@ -20,7 +20,7 @@ import ( "context" "errors" "fmt" - "strconv" + //"strconv" "time" "github.com/CortexFoundation/CortexTheseus/common/hexutil" @@ -72,7 +72,7 @@ func (m *Monitor) rpcBlockByNumber(blockNumber uint64) (*types.Block, error) { rpcBlockMeter.Mark(1) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - err := m.cl.CallContext(ctx, block, "ctxc_getBlockByNumber", "0x"+strconv.FormatUint(blockNumber, 16), true) + err := m.cl.CallContext(ctx, block, "ctxc_getBlockByNumber", hexutil.EncodeUint64(blockNumber), true) if err == nil { return block, nil }