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 (#134)
  • Loading branch information
VojtechVitek authored Aug 9, 2024
1 parent c929bb1 commit 8264025
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

1 comment on commit 8264025

@pkieltyka
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @VojtechVitek I've merged and tagged ethkit v1.27.3

Please sign in to comment.