Skip to content

test: RPC coverage linter + related fixes for listaddressbalances#7279

Open
knst wants to merge 6 commits intodashpay:developfrom
knst:fix-coverage-check
Open

test: RPC coverage linter + related fixes for listaddressbalances#7279
knst wants to merge 6 commits intodashpay:developfrom
knst:fix-coverage-check

Conversation

@knst
Copy link
Copy Markdown
Collaborator

@knst knst commented Apr 10, 2026

Issue being fixed or feature implemented

  • listaddressbalances returns results that is not matched with its doc and it causes failure on debug builds such as:
 $ listaddressbalances
Internal bug detected: std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); }) rpc/util.cpp:530 (HandleRequest) Dash Core v23.1.2-320-ge9b93e3b87be-dirty Please report this issue here: https://github.com/dashpay/dash/issues  (code -1) 

Further investigation discovered the bug, that exclude all wallet RPCs from coverage linter.

What was done?

  • fixes doc for RPC listaddressbalances
  • implementation of listaddressbalances moved between files to where it is supposed to be
  • adds functional tests for listaddressbalances
  • fixes coverage linter to add all wallet RPCs
  • backport test: fix RPC coverage check bitcoin/bitcoin#33064 (fixes coverage linter and add test for abortrescan RPC)

Backport candidate

only this commit is considerable useful for backporting: fix: RPC doc for listaddressbalances

How Has This Been Tested?

See updates in functional tests

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

knst and others added 6 commits April 11, 2026 00:23
8aed477 test: fix RPC coverage check (Brandon Odiwuor)
2630b64 test: add abortrescan RPC test (Brandon Odiwuor)

Pull request description:

  This is bitcoin#27593 cleaned up / rebased, now that the legacy wallet has been dropped.

  Closes bitcoin#27593.

ACKs for top commit:
  maflcko:
    lgtm ACK 8aed477
  cedwies:
    ACK 8aed477

Tree-SHA512: 14a28b1ef0c1f63236d04c2ff6c11adddc40642e4a23d30398e8a03fc47f911465af91affc6e66ee2d548515ef4f65fb1cb5d69985c5a771a17b1c9c009f48ad

Co-authored-by: merge-script <fanquake@gmail.com>
@knst knst added this to the 24 milestone Apr 10, 2026
@thepastaclaw
Copy link
Copy Markdown

thepastaclaw commented Apr 10, 2026

✅ Review complete (commit 53cd792)

@github-actions
Copy link
Copy Markdown

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Walkthrough

The PR refactors the listaddressbalances RPC implementation by moving it from src/wallet/rpc/wallet.cpp to src/wallet/rpc/coins.cpp, converting it from a static local definition to an externally declared function. The test framework is updated to support conditional wallet initialization via a new uses_wallet flag that controls whether the -disablewallet startup parameter is applied. Functional tests are enhanced to exercise the listaddressbalances RPC method and verify rescan behavior, and RPC coverage tracking is updated accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main changes: fixing RPC coverage linter issues and related fixes for the listaddressbalances RPC.
Description check ✅ Passed The PR description clearly explains the bug being fixed (listaddressbalances RPC documentation mismatch causing debug build failures), what was done (moved implementation, fixed docs, added tests, fixed coverage linter), and how it was tested.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@knst knst added the RPC Some notable changes to RPC params/behaviour/descriptions label Apr 10, 2026
Copy link
Copy Markdown

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

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

Code Review

This backport looks clean on the checked-out SHA. listaddressbalances is moved to the wallet RPC coins module and still registered correctly, and the functional-test coverage plumbing change does what it intends: the cache node now advertises wallet RPCs for coverage reference generation via uses_wallet=True, while tests that never opt into wallet options still run with -disablewallet. I did not find a Dash-specific incompatibility or missing prerequisite on this head.

Reviewed commit: 53cd792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-23.1.x RPC Some notable changes to RPC params/behaviour/descriptions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants