Skip to content

Commit

Permalink
cgh: use geth for maxInt
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Nov 13, 2024
1 parent 32138d7 commit 0634d11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cli/server/api_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0634d11

Please sign in to comment.