Skip to content

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jun 20, 2023
1 parent 7cb397e commit d8155fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ The following emojis are used to highlight certain changes:
* 🛠 The `ipns` package has been refactored. You should no longer use the direct Protobuf
version of the IPNS Record. Instead, we have a shiny new `ipns.Record` type that wraps
all the required functionality to work the best as possible with IPNS v2 Records. Please
check the [documentation](https://pkg.go.dev/github.com/ipfs/boxo/ipns) for more information.
check the [documentation](https://pkg.go.dev/github.com/ipfs/boxo/ipns) for more information,
and follow [ipfs/specs#376](https://github.com/ipfs/specs/issues/376) for related IPIP.

### Removed

Expand Down
24 changes: 12 additions & 12 deletions ipns/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,39 @@ import (
const MaxRecordSize int = 10 << (10 * 1)

// ErrExpiredRecord is returned when an IPNS [Record] is invalid due to being expired.
var ErrExpiredRecord = errors.New("the IPNS record is expired")
var ErrExpiredRecord = errors.New("record is expired")

// ErrUnrecognizedValidity is returned when an IPNS [Record] has an unknown validity type.
var ErrUnrecognizedValidity = errors.New("the IPNS record contains an unrecognized validity type")
var ErrUnrecognizedValidity = errors.New("record contains an unrecognized validity type")

// ErrInvalidValidity is returned when an IPNS [Record] has a known validity type,
// but the validity value is invalid.
var ErrInvalidValidity = errors.New("the IPNS record contains an invalid validity")
var ErrInvalidValidity = errors.New("record contains an invalid validity")

// ErrRecordSize is returned when an IPNS [Record] exceeds the maximum size.
var ErrRecordSize = errors.New("the IPNS record exceeds allowed size limit")
var ErrRecordSize = errors.New("record exceeds allowed size limit")

// ErrDataMissing is returned when an IPNS [Record] is missing the data field.
var ErrDataMissing = errors.New("the IPNS record is missing the data field")
var ErrDataMissing = errors.New("record is missing the dag-cbor data field")

// ErrInvalidRecord is returned when an IPNS [Record] is malformed.
var ErrInvalidRecord = errors.New("the IPNS record is malformed")
var ErrInvalidRecord = errors.New("record is malformed")

// ErrPublicKeyMismatch is return when the public key embedded in an IPNS [Record]
// does not match the expected public key.
var ErrPublicKeyMismatch = errors.New("the IPNS record public key does not match the expected public key")
var ErrPublicKeyMismatch = errors.New("record public key does not match the expected public key")

// ErrPublicKeyNotFound is returned when the public key is not found.
var ErrPublicKeyNotFound = errors.New("public key not found")

// ErrInvalidPublicKey is returned when an IPNS [Record] has an invalid public key,
var ErrInvalidPublicKey = errors.New("the IPNS record public key invalid")
var ErrInvalidPublicKey = errors.New("public key invalid")

// ErrSignature is returned when an IPNS [Record] fails signature verification.
var ErrSignature = errors.New("the IPNS record signature verification failed")
var ErrSignature = errors.New("signature verification failed")

// ErrInvalidName is returned when an IPNS [Name] is invalid.
var ErrInvalidName = errors.New("the IPNS name is invalid")
var ErrInvalidName = errors.New("name is invalid")

// ErrInvalidPath is returned when an IPNS Record has an invalid path.
var ErrInvalidPath = errors.New("the IPNS record path invalid")
// ErrInvalidPath is returned when an IPNS [Record] has an invalid path.
var ErrInvalidPath = errors.New("value is not a valid content path")

0 comments on commit d8155fa

Please sign in to comment.