-
Notifications
You must be signed in to change notification settings - Fork 662
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
Query ViewState with with non-existing account id and invalid prefix does not return error as expected #2793
Comments
It might be by design, so it is yet to be decided if we want to return Not Found (I guess, it is nice to have it this way). |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
@frol @khorolets what is the status of this issue? |
@miraclx I believe with the recent strictly-typed AccountId we addressed this issue. Can you try removing the |
Indeed! We go from this: test test_view_state_non_existing_account_invalid_prefix ... FAILED
failures:
---- test_view_state_non_existing_account_invalid_prefix stdout ----
thread 'test_view_state_non_existing_account_invalid_prefix' panicked at 'queried view account for not exsiting account, but received success instead of error', chain/jsonrpc/tests/rpc_query.rs:659:9 to this: nearcore/chain/jsonrpc/tests/rpc_query.rs Line 656 in 9f5e20b
test test_view_state_non_existing_account_invalid_prefix ... FAILED
failures:
---- test_view_state_non_existing_account_invalid_prefix stdout ----
thread 'test_view_state_non_existing_account_invalid_prefix' panicked at 'called `Result::unwrap()` on an `Err` value: ParseAccountError(Invalid, "\u{0}\u{0}\u{0}\u{0}\u{0}\u{4}\u{0}\u{0}\u{0}\u{8}\u{0}\u{0}\u{0}\u{0}\u{0}eeeeeeeeeeeeeeeeeeeeeeeeeeeee")', chain/jsonrpc/tests/rpc_query.rs:656:148 Yay for early validation. We can proceed to resolve these issues. I can take this one. |
Great! Please, take it! |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
Since introducing the strictly typed `AccountId`, the following issues are non-existent: - #2790 - #2791 - #2792 - #2793 In the case of #2789, as pointed out in #2789 (comment), we have `integration-tests` replacing this unit test. https://github.com/near/nearcore/blob/2677f00918b7425beafce562d4fdff67692a3a3f/integration-tests/src/tests/nearcore/rpc_nodes.rs#L309-L345 And finally, #2800 seems to work properly.
Describe the bug
Calling query method
view_state
withaccount_id
that doesn't exist returnsresult
with data instead of error. But it might be intentional /cc @frolTo Reproduce
I'm including rust test
test_view_state_non_existing_account_invalid_prefix
to reproduce it. #2740Expected behavior
I expect to receive response with
error
key instead ofresult
Screenshots
If applicable, add screenshots to help explain your problem.
Version (please complete the following information):
Additional context
it is found while implementing #2422
The text was updated successfully, but these errors were encountered: