Skip to content

Commit

Permalink
POS-2821: solve build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Feb 6, 2025
1 parent 2b2a463 commit 9e56f25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions helper/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ func parseTopics(out interface{}, fields abi.Arguments, topics []common.Hash) er
field.Set(reflect.ValueOf(uint32(num.Uint64())))

Check failure on line 116 in helper/unpack.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion uint64 -> uint32 (gosec)
case reflect.Uint64:
num := new(big.Int).SetBytes(topics[0][:])
int64Value := num.Int64()
if int64Value < math.MaxUint64 || int64Value > math.MaxUint64 {
return fmt.Errorf("value out of range for uint64: %d", int64Value)
}
field.Set(reflect.ValueOf(num.Uint64()))
default:
// Ran out of plain primitive types, try custom types
Expand Down
2 changes: 1 addition & 1 deletion types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (valID ValidatorID) Bytes() []byte {

// Int converts validator ID to int
func (valID ValidatorID) Int() int {
if uint64(valID) > uint64(^0) {
if uint64(valID) > uint64(int(^uint(0)>>1)) {
panic(fmt.Sprintf("ValidatorID value too large to convert to int: %d", valID))
}
return int(valID)

Check failure on line 206 in types/validator.go

View workflow job for this annotation

GitHub Actions / lint

G115: integer overflow conversion uint64 -> int (gosec)
Expand Down

0 comments on commit 9e56f25

Please sign in to comment.