Skip to content

change(rpc): Update getaddressbalance RPC to return received field #9295

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

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Feb 24, 2025

Motivation

Updates the getaddressbalance RPC to accept either a single address string or a list of them to match zcashd, and adds the received field on the method's response.

Closes #8452.
Closes #9463.

Depends-On: #9539.

Solution

  • Bumps db format version for address balances to include a received field, and adds an in-place format upgrade,
  • Adds a mechanism for freezing block commits until some in-place format upgrades are complete,
  • Parses single address strings passed to RPC methods accepting AddressStrings as a Vec with one item, and
  • Adds the received field to the getaddressbalance RPC output.

Tests

This PR still needs a manual test to check that the output matches zcashd.
The changes to the RPC should be covered by existing snapshot tests.

PR Checklist

  • The PR name is suitable for the release notes.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.
  • If the PR shouldn't be in the release notes, it has the
    C-exclude-from-changelog label.

@arya2 arya2 added S-blocked Status: Blocked on other tasks A-rpc Area: Remote Procedure Call interfaces A-state Area: State / database changes P-Medium ⚡ labels Feb 24, 2025
@arya2 arya2 self-assigned this Feb 24, 2025
Copy link
Collaborator

@conradoplg conradoplg left a comment

Choose a reason for hiding this comment

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

Looks good

Just FYI @arya2 I pushed a small fix to the RPC serialization test to pass CI (I looked into it to see why I was failing and noticed it was simple to fix)

@arya2
Copy link
Contributor Author

arya2 commented Jun 10, 2025

Thank you. @mpguerra, the last change looks good to me if you could re-approve. It adds the received field to the raw json that I forgot.

Copy link
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

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

Resolved conversations and approved based on @conradoplg 's last approval

mergify bot added a commit that referenced this pull request Jun 11, 2025
@mergify mergify bot merged commit ae18728 into main Jun 11, 2025
169 checks passed
@mergify mergify bot deleted the update-getaddressbalance branch June 11, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Area: Remote Procedure Call interfaces A-state Area: State / database changes P-Medium ⚡
Projects
None yet
4 participants