Skip to content

Commit 0634d11

Browse files
committed
cgh: use geth for maxInt
1 parent 32138d7 commit 0634d11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/cli/server/api_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"strconv"
77

8+
"github.com/ethereum/go-ethereum/common/math"
89
"github.com/ethereum/go-ethereum/core/types"
910
"github.com/ethereum/go-ethereum/rpc"
1011

@@ -118,7 +119,7 @@ func getRpcBlockNumberFromString(blockNumber string) (rpc.BlockNumber, error) {
118119
if err != nil {
119120
return rpc.BlockNumber(0), errors.New("invalid block number")
120121
}
121-
if blckNum > uint64(^uint32(0)) {
122+
if blckNum > math.MaxInt64 {
122123
return rpc.BlockNumber(0), errors.New("block number out of range")
123124
}
124125
return rpc.BlockNumber(blckNum), nil

0 commit comments

Comments
 (0)