-
Notifications
You must be signed in to change notification settings - Fork 864
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 in @solana/transactions
to coded exceptions
#2207
Convert errors in @solana/transactions
to coded exceptions
#2207
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
1579936
to
bfa481d
Compare
packages/errors/src/messages.ts
Outdated
[SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_CANNOT_PAY_FEES]: | ||
'This transaction includes an address (`$programAddress`) which is both ' + | ||
'invoked and set as the fee payer. Program addresses may not pay fees', |
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'm not 100% sure if this error should be this, or:
[SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_CANNOT_PAY_FEES]: | |
'This transaction includes an address (`$programAddress`) which is both ' + | |
'invoked and set as the fee payer. Program addresses may not pay fees', | |
[SOLANA_ERROR__TRANSACTION_PROGRAMS_CANNOT_PAY_FEES]: | |
'This transaction includes a program (`$programAddress`) which is set as ' + | |
'the fee payer. Program addresses may not pay fees', |
ie. does it matter that it's invoked, or is it that programs can't pay fees, period? cc/ @joncinque
highestKnownIndex: addresses.length - 1, | ||
highestRequestedIndex: highestIndex, |
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.
Modified this to include the highest index available.
bfa481d
to
49bb70a
Compare
cf80a05
to
95a3903
Compare
49bb70a
to
46e2e72
Compare
[SOLANA_ERROR__TRANSACTION_EXPECTED_BLOCKHASH_LIFETIME]: 'Transaction does not have a blockhash lifetime', | ||
[SOLANA_ERROR__TRANSACTION_EXPECTED_NONCE_LIFETIME]: 'Transaction is not a durable nonce transaction', | ||
[SOLANA_ERROR__TRANSACTION_FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING]: | ||
'Contents of these address lookup tables unknown: $lookupTableAddresses', |
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.
Changed this.
46e2e72
to
cfb0332
Compare
packages/errors/src/codes.ts
Outdated
export const SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_CANNOT_PAY_FEES = 99901 as const; | ||
export const SOLANA_ERROR__TRANSACTION_INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = 99902 as const; | ||
export const SOLANA_ERROR__TRANSACTION_EXPECTED_BLOCKHASH_LIFETIME = 99903 as const; | ||
export const SOLANA_ERROR__TRANSACTION_EXPECTED_NONCE_LIFETIME = 99904 as const; | ||
export const SOLANA_ERROR__TRANSACTION_VERSION_NUMBER_OUT_OF_RANGE = 99905 as const; | ||
export const SOLANA_ERROR__TRANSACTION_FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = 99906 as const; | ||
export const SOLANA_ERROR__TRANSACTION_FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE = 99907 as const; | ||
export const SOLANA_ERROR__TRANSACTION_FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND = 99908 as const; | ||
export const SOLANA_ERROR__TRANSACTION_FAILED_TO_DECOMPILE_FEE_PAYER_MISSING = 99909 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 don't feel too strongly about this but how do you guys feel about double-underscoring after the prefix so it's clear that we are creating a "group" of error codes?
Cc @buffalojoec @steveluscher @mcintyre94
export const SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES = 99901 as const;
export const SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = 99902 as const;
export const SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME = 99903 as const;
export const SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME = 99904 as const;
export const SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = 99905 as const;
export const SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = 99906 as const;
export const SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE = 99907 as const;
export const SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND = 99908 as const;
export const SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING = 99909 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 also don't feel too strongly here but the double underscore is a bit more readable.
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.
cfb0332
to
3468945
Compare
🎉 This PR is included in version 1.90.1 🎉 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.