neo-go/pkg/services/rpcsrv/util.go
Roman Khimov 43a59adbd0 rpc/server: move to services/rpcsrv
`server` is not a good package name and it's an internal service, so it can be
just about anywhere.
2022-07-21 22:14:12 +03:00

20 lines
316 B
Go

package rpcsrv
import (
"errors"
"math"
)
func checkUint32(i int) error {
if i < 0 || i > math.MaxUint32 {
return errors.New("value should fit uint32")
}
return nil
}
func checkInt32(i int) error {
if i < math.MinInt32 || i > math.MaxInt32 {
return errors.New("value should fit int32")
}
return nil
}