From 55ee07dd6b377d831f89bb9e98614bd7fd39350a Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 25 Nov 2025 22:55:45 +0100 Subject: [PATCH] Update hexutil.go --- common/hexutil/hexutil.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/hexutil/hexutil.go b/common/hexutil/hexutil.go index d6b6b867f2..3a4b4c1bee 100644 --- a/common/hexutil/hexutil.go +++ b/common/hexutil/hexutil.go @@ -82,7 +82,8 @@ func MustDecode(input string) []byte { // Encode encodes b as a hex string with 0x prefix. func Encode(b []byte) string { enc := make([]byte, len(b)*2+2) - copy(enc, "0x") + enc[0] = '0' + enc[1] = 'x' hex.Encode(enc[2:], b) return string(enc) } @@ -113,7 +114,8 @@ func MustDecodeUint64(input string) uint64 { // EncodeUint64 encodes i as a hex string with 0x prefix. func EncodeUint64(i uint64) string { enc := make([]byte, 2, 10) - copy(enc, "0x") + enc[0] = '0' + enc[1] = 'x' return string(strconv.AppendUint(enc, i, 16)) }