Skip to content

Commit 32894ab

Browse files
author
sammyne
committed
docs(errors): sort errors declaration
1 parent 86b6d7e commit 32894ab

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

errors.go

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,43 @@ import (
66
)
77

88
var (
9-
// ErrDeriveHardFromPublic describes an error in which the caller
10-
// attempted to derive a hardened extended key from a public key.
11-
ErrDeriveHardFromPublic = errors.New("cannot derive a hardened key " +
12-
"from a public key")
9+
// ErrBadChecksum describes an error in which the checksum encoded with
10+
// a serialized extended key does not match the calculated value.
11+
ErrBadChecksum = errors.New("bad extended key checksum")
1312

1413
// ErrDeriveBeyondMaxDepth describes an error in which the caller
15-
// has attempted to derive more than 255 keys from a root key.
14+
// has attempted to derive a key chain longer than 255 from a root key.
1615
ErrDeriveBeyondMaxDepth = errors.New("cannot derive a key with more than " +
16+
1717
"255 indices in its path")
18+
// ErrDeriveHardFromPublic describes an error in which the caller
19+
// attempted to derive a hardened extended key from a public key.
20+
ErrDeriveHardFromPublic = errors.New("cannot derive a hardened key " +
21+
"from a public key")
1822

1923
// ErrInvalidChild describes an error in which the child at a specific
2024
// index is invalid due to the derived key falling outside of the valid
21-
// range for secp256k1 private keys. This error indicates the caller
25+
// range for secp256k1 private keys. This error indicates the caller
2226
// should simply ignore the invalid child extended key at this index and
2327
// increment to the next index.
2428
ErrInvalidChild = errors.New("the extended key at this index is invalid")
2529

26-
// ErrUnusableSeed describes an error in which the provided seed is not
27-
// usable due to the derived key falling outside of the valid range for
28-
// secp256k1 private keys. This error indicates the caller must choose
29-
// another seed.
30-
ErrUnusableSeed = errors.New("unusable seed")
30+
// ErrInvalidKeyLen describes an error in which the provided serialized
31+
// key isn't of the expected length.
32+
ErrInvalidKeyLen = errors.New("the provided serialized extended key " +
33+
"length is invalid")
3134

3235
// ErrInvalidSeedLen describes an error in which the provided seed or
3336
// seed length is not in the allowed range.
3437
ErrInvalidSeedLen = fmt.Errorf("seed length must be between %d and %d "+
3538
"bits", MinSeedBytes*8, MaxSeedBytes*8)
3639

37-
// ErrBadChecksum describes an error in which the checksum encoded with
38-
// a serialized extended key does not match the calculated value.
39-
ErrBadChecksum = errors.New("bad extended key checksum")
40-
41-
// ErrInvalidKeyLen describes an error in which the provided serialized
42-
// key is not the expected length.
43-
ErrInvalidKeyLen = errors.New("the provided serialized extended key " +
44-
"length is invalid")
45-
4640
// ErrNoEnoughEntropy signals more entropy is needed
4741
ErrNoEnoughEntropy = errors.New("more entropy is needed")
42+
43+
// ErrUnusableSeed describes an error in which the provided seed is not
44+
// usable due to the derived key falling outside of the valid range for
45+
// secp256k1 private keys. This error indicates the caller must choose
46+
// another seed.
47+
ErrUnusableSeed = errors.New("unusable seed")
4848
)

0 commit comments

Comments
 (0)