chore: improve error for UnknownAccessKey, UnknownGasKey#15167
Conversation
There was a problem hiding this comment.
Pull request overview
Updates query-related error strings so “unknown key” errors reflect that keys may have existed previously but are absent at the time of the query.
Changes:
- Adjust
RpcQueryErrordisplay messages forUnknownAccessKeyandUnknownGasKey. - Adjust client-side
QueryError::UnknownAccessKeydisplay message to match the new semantics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
chain/jsonrpc-primitives/src/types/query.rs |
Updates UnknownAccessKey / UnknownGasKey error messages to “does not exist while viewing”. |
chain/client-primitives/src/types.rs |
Updates QueryError::UnknownAccessKey error message to the new wording (including block height). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #15167 +/- ##
==========================================
+ Coverage 68.80% 69.05% +0.25%
==========================================
Files 921 923 +2
Lines 204156 204708 +552
Branches 204156 204708 +552
==========================================
+ Hits 140460 141364 +904
+ Misses 57890 57559 -331
+ Partials 5806 5785 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| block_hash: near_primitives::hash::CryptoHash, | ||
| }, | ||
| #[error("Access key for public key {public_key} has never been observed on the node")] | ||
| #[error("access key for public key {public_key} does not exist while viewing")] |
There was a problem hiding this comment.
It looks like the convention here is to have error message capitalized, so let's keep it consistent. Also please capitalize account in UnknownAccount
Updates error messages to reflect they show absence of key at time of viewing (rather than ever, as keys can be deleted)