Skip to content

Commit

Permalink
Temporary go-ethereum patch: Allow numbers with leading zeroes, e.g. …
Browse files Browse the repository at this point in the history
…0x09
  • Loading branch information
VojtechVitek committed Aug 9, 2024
1 parent c929bb1 commit 14b13b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions go-ethereum/common/hexutil/hexutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ func checkNumber(input string) (raw string, err error) {
if len(input) == 0 {
return "", ErrEmptyNumber
}
if len(input) > 1 && input[0] == '0' {
return "", ErrLeadingZero
}
// Temporary Sequence patch.
// Uncommented to allow numbers with leading zeroes, e.g. 0x09.
// if len(input) > 1 && input[0] == '0' {
// return "", ErrLeadingZero
// }
return input, nil
}

Expand Down
8 changes: 5 additions & 3 deletions go-ethereum/common/hexutil/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,11 @@ func checkNumberText(input []byte) (raw []byte, err error) {
if len(input) == 0 {
return nil, ErrEmptyNumber
}
if len(input) > 1 && input[0] == '0' {
return nil, ErrLeadingZero
}
// Temporary Sequence patch.
// Uncommented to allow numbers with leading zeroes, e.g. 0x09.
// if len(input) > 1 && input[0] == '0' {
// return nil, ErrLeadingZero
// }
return input, nil
}

Expand Down

0 comments on commit 14b13b8

Please sign in to comment.