Skip to content
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

return correct gRPC error codes #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LarryRuane
Copy link
Collaborator

closes #497

@LarryRuane
Copy link
Collaborator Author

This PR includes some whitespace changes to common/common_test.go because my IDE (vscode) automatically formats files, and an earlier commit to this file used a different formatting convention. I recommend viewing the diff with whitespace ignored (click on the gear symbol near the top of the Files changed (diff) page).

// Fetch the block using the verbose option ("1") because it provides
// both the list of txids, which we're not yet able to compute for
// Orchard (V5) transactions, and the block hash (block ID), which
// we need to fetch the raw data format of the same block. Don't fetch
// by height in case a reorg occurs between the two getblock calls;
// using block hash ensures that we're fetching the same block.
params[1] = json.RawMessage("1")
params := []json.RawMessage{heightJSON, json.RawMessage("1")}
result, rpcErr := RawRequest("getblock", params)
if rpcErr != nil {
// Check to see if we are requesting a height the zcashd doesn't have yet
Copy link

@upbqdn upbqdn Nov 14, 2024

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

It's -5 for hashes but -8 for heights. What is weird is the comment above mentioning that it should be a hash but it is not. That's not part of the PR though.

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.

Zcash rpc error codes are not being correctly mapped to GRPC responses.
3 participants