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.
This commit is contained in:
Roman Khimov 2022-05-31 16:51:19 +03:00
parent 3945e81857
commit 10110d4e70

View file

@ -10,7 +10,7 @@ import (
const ( const (
// MaxBytesLen is the maximum length of a serialized integer suitable for Neo VM. // 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 is a size of a big.Word (uint) in bytes.
wordSizeBytes = bits.UintSize / 8 wordSizeBytes = bits.UintSize / 8
) )