test(wallets): make the address-generation assertion genuinely isolate the regression - #922
Conversation
…e the regression The prior "strengthened" assertion (59d4b38) claimed to catch a dropped queue_core_address_request call, but the fixture wallet was never registered with WalletBackend, so load_core_addresses_for_receive's self-heal branch fired the identical status regardless — the assertion passed even with the explicit call removed. Add registered_wallet_screen_harness(), used only by add_receiving_address_button_opens_receive_dialog: registers the fixture wallet with the backend and waits (bounded 5s timeout) for a genuine non-empty monitored-address snapshot before the click, so load_core_addresses_for_receive takes its non-self-heal branch and the status can only originate from the button handler's own explicit call. The other three dialog tests are untouched, still using the original in-memory fixture. Verified: removing the explicit queue_core_address_request call now fails this test; restoring it passes again. Full wallets_screen module (7 tests), both clippy targets, and fmt all clean. Also trims an 8-line tombstone comment in the button handler down to present-state rationale only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change adds a reusable wallet screen harness, introduces a registered-wallet fixture that waits for monitored receive addresses, updates the add-address dialog test to use it, and clarifies the handler’s inline flow comment. ChangesWallet screen flow
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
🕓 Ready for review — 44 ahead in queue (commit 11a232c) |
…e the regression (dashpay#922) The prior "strengthened" assertion (59d4b38) claimed to catch a dropped queue_core_address_request call, but the fixture wallet was never registered with WalletBackend, so load_core_addresses_for_receive's self-heal branch fired the identical status regardless — the assertion passed even with the explicit call removed. Add registered_wallet_screen_harness(), used only by add_receiving_address_button_opens_receive_dialog: registers the fixture wallet with the backend and waits (bounded 5s timeout) for a genuine non-empty monitored-address snapshot before the click, so load_core_addresses_for_receive takes its non-self-heal branch and the status can only originate from the button handler's own explicit call. The other three dialog tests are untouched, still using the original in-memory fixture. Verified: removing the explicit queue_core_address_request call now fails this test; restoring it passes again. Full wallets_screen module (7 tests), both clippy targets, and fmt all clean. Also trims an 8-line tombstone comment in the button handler down to present-state rationale only. Co-authored-by: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
The crate-rename conflict resolution for upstream dashpay#922 (test(wallets): make the address-generation assertion genuinely isolate the regression) dropped the WalletOrigin import along with the dash_evo_tool:: duplicate imports it was merged next to. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Why this PR exists
wallet_screen_harness()never registers its fixture wallet withWalletBackend, soload_core_addresses_for_receive's self-heal branch fires the exact same"Generating a new address…"status regardless of whether the button handler's own explicitqueue_core_address_requestcall exists. Removing that explicit call and re-running the test still passed — the assertion added in test(wallets): assert address-generation status, not just dialog-open state #920 to guard against exactly that regression didn't actually guard against it.What was done
Added
registered_wallet_screen_harness(), used only byadd_receiving_address_button_opens_receive_dialog: registers the fixture wallet with the backend and waits (bounded 5s timeout) for a genuine non-empty monitored-address snapshot before the click, soload_core_addresses_for_receivetakes its non-self-heal branch and the status can only originate from the button handler's own explicit call. The other three dialog tests are untouched, still using the original in-memory fixture — no risk to their coverage.Also trims an 8-line tombstone comment in the button handler (narrating removed-code history that already lives in the original PR's commit message) down to present-state rationale only.
Testing
queue_core_address_requestcall from the button handler — test now fails (FAILED, panics on the missing status assertion). Restored the call — test passes again.cargo test --test kittest --all-features wallets_screen— full module, 7/7 pass by name, no regressions in the other three dialog tests.cargo clippy --all-features --bin dash-evo-tool -- -D warningsand--test kittest -- -D warnings— clean.cargo fmt --all -- --check— clean.Breaking changes
None.
Checklist
cargo fmt --allcargo clippycleanAttribution
🤖 Co-authored by Claudius the Magnificent AI Agent
Summary by CodeRabbit
No user-facing behavior changes were introduced.