From 0634d11d8652cbd57571e47a63b3de15157e5090 Mon Sep 17 00:00:00 2001 From: marcello33 <marcelloardizzone@hotmail.it> Date: Wed, 13 Nov 2024 15:01:55 +0100 Subject: [PATCH] cgh: use geth for maxInt --- internal/cli/server/api_service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/cli/server/api_service.go b/internal/cli/server/api_service.go index 2861cf3a9d..b5469c3752 100644 --- a/internal/cli/server/api_service.go +++ b/internal/cli/server/api_service.go @@ -5,6 +5,7 @@ import ( "errors" "strconv" + "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rpc" @@ -118,7 +119,7 @@ func getRpcBlockNumberFromString(blockNumber string) (rpc.BlockNumber, error) { if err != nil { return rpc.BlockNumber(0), errors.New("invalid block number") } - if blckNum > uint64(^uint32(0)) { + if blckNum > math.MaxInt64 { return rpc.BlockNumber(0), errors.New("block number out of range") } return rpc.BlockNumber(blckNum), nil