Skip to content

Commit

Permalink
fix Incorrect conversion between integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Jun 19, 2024
1 parent 9b3746f commit 88b512b
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ func DecodeUint64orHex(val *string) (uint64, error) {
return strconv.ParseUint(str, base, hex.BitSize64)
}

// DecodeInt64orHex decodes a string uint64 or hex string into a uint64
func DecodeInt64orHex(val *string) (int64, error) {
if val == nil {
return 0, nil
}

str := *val
base := 10
if strings.HasPrefix(str, "0x") {
str = str[2:]
base = 16
}
return strconv.ParseInt(str, base, hex.BitSize64)
}

// DecodeUint256orHex decodes a string uint256 or hex string into a bit.Int
func DecodeUint256orHex(val *string) (*big.Int, error) {
if val == nil {
Expand Down

0 comments on commit 88b512b

Please sign in to comment.