From f919f50293edcbde6c615c358e10605885b989e0 Mon Sep 17 00:00:00 2001 From: lupin17 <59-quanta.middle@icloud.com> Date: Fri, 12 Dec 2025 15:24:28 +0100 Subject: [PATCH] Update types.go --- rpc/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/types.go b/rpc/types.go index 85f15344e8..86449e9ea2 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -78,8 +78,8 @@ const ( // - an out of range error when the given block number is either too little or too large func (bn *BlockNumber) UnmarshalJSON(data []byte) error { input := strings.TrimSpace(string(data)) - if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { - input = input[1 : len(input)-1] + if n := len(input); n >= 2 && input[0] == '"' && input[n-1] == '"' { + input = input[1 : n-1] } switch input {