Skip to content

Commit

Permalink
storse: update < to !=
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Nov 30, 2023
1 parent 21be171 commit 91c6d2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stores/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 91c6d2a

Please sign in to comment.