From 91c6d2af2ca246430d06ca2d82a6298e1b7c93ad Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Thu, 30 Nov 2023 10:49:44 +0100 Subject: [PATCH] storse: update < to != --- stores/types.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stores/types.go b/stores/types.go index 830785b50..9ec62c9ac 100644 --- a/stores/types.go +++ b/stores/types.go @@ -75,7 +75,7 @@ func (h *hash256) Scan(value interface{}) error { return errors.New(fmt.Sprint("failed to unmarshal hash256 value:", value)) } if len(bytes) != len(hash256{}) { - return fmt.Errorf("failed to unmarshal hash256 value due to insufficient bytes %v < %v: %v", len(bytes), len(fileContractID{}), value) + return fmt.Errorf("failed to unmarshal hash256 value due to invalid number of bytes %v != %v: %v", len(bytes), len(fileContractID{}), value) } *h = *(*hash256)(bytes) return nil @@ -97,8 +97,8 @@ func (fcid *fileContractID) Scan(value interface{}) error { if !ok { return errors.New(fmt.Sprint("failed to unmarshal fcid value:", value)) } - if len(bytes) < len(fileContractID{}) { - return fmt.Errorf("failed to unmarshal fcid value due to insufficient bytes %v < %v: %v", len(bytes), len(fileContractID{}), value) + if len(bytes) != len(fileContractID{}) { + return fmt.Errorf("failed to unmarshal fcid value due to invalid number of bytes %v != %v: %v", len(bytes), len(fileContractID{}), value) } *fcid = *(*fileContractID)(bytes) return nil @@ -147,8 +147,8 @@ func (pk *publicKey) Scan(value interface{}) error { if !ok { return errors.New(fmt.Sprint("failed to unmarshal publicKey value:", value)) } - if len(bytes) < len(types.PublicKey{}) { - return fmt.Errorf("failed to unmarshal publicKey value due to insufficient bytes %v < %v: %v", len(bytes), len(publicKey{}), value) + if len(bytes) != len(types.PublicKey{}) { + return fmt.Errorf("failed to unmarshal publicKey value due invalid number of bytes %v != %v: %v", len(bytes), len(publicKey{}), value) } *pk = *(*publicKey)(bytes) return nil