-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert errors to coded exceptions in @solana/keys
#2245
Convert errors to coded exceptions in @solana/keys
#2245
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @steveluscher and the rest of your teammates on |
f7dd0d1
to
ea29eaa
Compare
877e37b
to
4d0a5cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from one naming comment, I'm happy with this!
packages/errors/src/codes.ts
Outdated
export const SOLANA_ERROR__KEYS_PRIVATE_KEY_BYTE_LENGTH_OUT_OF_RANGE = 3704000 as const; | ||
export const SOLANA_ERROR__KEYS_SIGNATURE_BYTE_LENGTH_OUT_OF_RANGE = 3704001 as const; | ||
export const SOLANA_ERROR__KEYS_SIGNATURE_STRING_LENGTH_OUT_OF_RANGE = 3704002 as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only SIGNATURE_STRING_LENGTH_OUT_OF_RANGE
is a valid "out of range" errors. It feels weird to me to get SIGNATURE_BYTE_LENGTH_OUT_OF_RANGE
for signature bytes. In fact, just reading this PR, I let myself thinking "What? I didn't know our signatures could be anything else than 64 bytes long". So I think we should make the following change:
export const SOLANA_ERROR__KEYS_PRIVATE_KEY_BYTE_LENGTH_OUT_OF_RANGE = 3704000 as const; | |
export const SOLANA_ERROR__KEYS_SIGNATURE_BYTE_LENGTH_OUT_OF_RANGE = 3704001 as const; | |
export const SOLANA_ERROR__KEYS_SIGNATURE_STRING_LENGTH_OUT_OF_RANGE = 3704002 as const; | |
export const SOLANA_ERROR__KEYS_INVALID_PRIVATE_KEY_BYTE_LENGTH = 3704000 as const; | |
export const SOLANA_ERROR__KEYS_INVALID_SIGNATURE_BYTE_LENGTH = 3704001 as const; | |
export const SOLANA_ERROR__KEYS_SIGNATURE_STRING_LENGTH_OUT_OF_RANGE = 3704002 as const; |
097c92d
to
1041fb6
Compare
0d0495c
to
70e1e81
Compare
Merge activity
|
70e1e81
to
1fbcafc
Compare
🎉 This PR is included in version 1.91.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Addresses #2118.