crypto: improve error messages for base58

Golint:
  error strings should not be capitalized or end with punctuation or a newline

Refs. #213.
This commit is contained in:
Roman Khimov 2019-09-03 18:04:30 +03:00
parent 89ed00ddfb
commit a74518691c

View file

@ -96,11 +96,11 @@ func Base58CheckDecode(s string) (b []byte, err error) {
} }
if len(b) < 5 { if len(b) < 5 {
return nil, errors.New("invalid base-58 check string: missing checksum.") return nil, errors.New("invalid base-58 check string: missing checksum")
} }
if !bytes.Equal(hash.Checksum(b[:len(b)-4]), b[len(b)-4:]) { if !bytes.Equal(hash.Checksum(b[:len(b)-4]), b[len(b)-4:]) {
return nil, errors.New("invalid base-58 check string: invalid checksum.") return nil, errors.New("invalid base-58 check string: invalid checksum")
} }
// Strip the 4 byte long hash. // Strip the 4 byte long hash.