From 14b13b8c8c2fc6ecb4df96ed810b5ffd99acd4b5 Mon Sep 17 00:00:00 2001 From: Vojtech Vitek Date: Fri, 9 Aug 2024 10:44:17 +0200 Subject: [PATCH] Temporary go-ethereum patch: Allow numbers with leading zeroes, e.g. 0x09 --- go-ethereum/common/hexutil/hexutil.go | 8 +++++--- go-ethereum/common/hexutil/json.go | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/go-ethereum/common/hexutil/hexutil.go b/go-ethereum/common/hexutil/hexutil.go index d3201850..a1cb892c 100644 --- a/go-ethereum/common/hexutil/hexutil.go +++ b/go-ethereum/common/hexutil/hexutil.go @@ -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 } diff --git a/go-ethereum/common/hexutil/json.go b/go-ethereum/common/hexutil/json.go index e0ac98f5..ce2d8cc6 100644 --- a/go-ethereum/common/hexutil/json.go +++ b/go-ethereum/common/hexutil/json.go @@ -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 }