Skip to content

chore: improve error for UnknownAccessKey, UnknownGasKey#15167

Merged
darioush merged 4 commits into
near:masterfrom
darioush:unknonwn-key-error
Feb 20, 2026
Merged

chore: improve error for UnknownAccessKey, UnknownGasKey#15167
darioush merged 4 commits into
near:masterfrom
darioush:unknonwn-key-error

Conversation

@darioush

@darioush darioush commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Updates error messages to reflect they show absence of key at time of viewing (rather than ever, as keys can be deleted)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RpcQueryError display messages for UnknownAccessKey and UnknownGasKey.
  • Adjust client-side QueryError::UnknownAccessKey display 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.

Comment thread chain/jsonrpc-primitives/src/types/query.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread chain/jsonrpc-primitives/src/types/view_access_key.rs
@darioush darioush requested a review from pugachAG February 19, 2026 21:50
@darioush darioush marked this pull request as ready for review February 19, 2026 21:50
@darioush darioush requested a review from a team as a code owner February 19, 2026 21:50
@codecov

codecov Bot commented Feb 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.05%. Comparing base (3b77af7) to head (8386a90).
⚠️ Report is 6 commits behind head on master.

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     
Flag Coverage Δ
pytests-nightly 1.29% <ø> (-0.01%) ⬇️
unittests 68.57% <ø> (?)
unittests-nightly 68.63% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the convention here is to have error message capitalized, so let's keep it consistent. Also please capitalize account in UnknownAccount

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 8386a90

@darioush darioush enabled auto-merge February 20, 2026 13:55
@darioush darioush added this pull request to the merge queue Feb 20, 2026
Merged via the queue into near:master with commit d3c3161 Feb 20, 2026
32 checks passed
@darioush darioush deleted the unknonwn-key-error branch February 20, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants