Skip to content

fix(key-wallet): return the next index of an exhausted single-pool account - #1341

Merged
xdustinface merged 1 commit into
devfrom
fix/next-address-index-exhausted-pool
Nov 6, 2026
Merged

xdustinface merged 1 commit into
devfrom
fix/next-address-index-exhausted-pool

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

When every generated address of a single-pool account (CoinJoin, Identity*, AssetLock*, Provider*, DashPay*, PlatformPayment) was used, get_next_address_index returned None. A Standard account returns highest_generated + 1 in the same case.

The three index getters now share one helper, so single-pool accounts also return the next index to derive.

Closes #730

PR Hygiene · dc96966

  • Bots — coderabbitai skipped after its own rate limit
  • Self-review — address xdustinface requested changes, then post /self-reviewed
  • Build green
  • Approvals
    • key-wallet (key-wallet/src/managed_account/managed_account_trait.rs) — QuantumExplorer or xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4e49ea9 and dc96966.

Files selected for processing: 1

  • key-wallet/src/managed_account/managed_account_trait.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.17%. Comparing base (4e49ea9) to head (dc96966).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...allet/src/managed_account/managed_account_trait.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1341      +/-   ##
==========================================
- Coverage   85.17%   85.17%   -0.01%     
==========================================
  Files         268      268              
  Lines       68101    68100       -1     
==========================================
- Hits        58005    58004       -1     
  Misses      10096    10096              
Flag Coverage Δ
core 82.43% <ø> (ø)
rpc 52.10% <ø> (ø)
spv 94.02% <ø> (-0.01%) ⬇️
wallet 83.12% <0.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
...allet/src/managed_account/managed_account_trait.rs 44.28% <0.00%> (+0.16%) ⬆️

... and 2 files with indirect coverage changes

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Bots are done — your move: address xdustinface requested changes, then post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 5, 2026

@xdustinface xdustinface left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fix has no regression test. The PR only touches managed_account_trait.rs, and nothing in the workspace calls get_next_address_index, get_next_receive_address_index or get_next_change_address_index. With the old code, a CoinJoin account whose 100 external addresses are all marked used returns None, and with your change it returns Some(100), so a test can lock this in. Please add one in key-wallet/src/tests/address_reservation_tests.rs next to test_reserve_receive_on_non_standard_account_errors, which already builds a CoinJoin ManagedCoreFundsAccount: mark every address used via mark_address_used and assert get_next_address_index() == Some(highest_generated + 1).

@xdustinface
xdustinface merged commit e7529b2 into dev Nov 6, 2026
37 of 38 checks passed
@xdustinface
xdustinface deleted the fix/next-address-index-exhausted-pool branch November 6, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

key-wallet: get_next_address_index returns None for exhausted single-pool accounts

2 participants