From 10110d4e700c7263dcc19a64ce1e6d0dab83c88c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 31 May 2022 16:51:19 +0300 Subject: [PATCH] bigint: correct MaxBytesLen It can't be 33, positive signed int256 all fit into 32 bytes (no need for leading zero), negative ones fit into 32 bytes as well. --- pkg/encoding/bigint/bigint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/encoding/bigint/bigint.go b/pkg/encoding/bigint/bigint.go index 26a6849f8..35081992a 100644 --- a/pkg/encoding/bigint/bigint.go +++ b/pkg/encoding/bigint/bigint.go @@ -10,7 +10,7 @@ import ( const ( // MaxBytesLen is the maximum length of a serialized integer suitable for Neo VM. - MaxBytesLen = 33 // 32 bytes for a 256-bit integer plus 1 if padding needed + MaxBytesLen = 32 // 256-bit signed integer // wordSizeBytes is a size of a big.Word (uint) in bytes. wordSizeBytes = bits.UintSize / 8 )