feat(identity): restore QR/receive-deposit funding for register and top-up - #877
Conversation
…tities only HD-wallet-backed identity keys are derived on demand from the wallet's own seed and already covered by that wallet's password; the Key Protection section is hidden entirely for such identities since there is no separate vault key to protect. Addresses PR #860 review comment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e 1b) Test case specification for restoring IDN-014 receive-deposit funding on the Register and Top-Up identity screens. Descriptions/expected-outcomes only, no test code. Corrects the Phase-1a brief: detection is single-address equality (not known_addresses), funding_address is per-screen, deposit transitions are unit-level via display_task_result (not kittest-reachable today). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task breakdown for developer-bilby: shared pure helper + FundingMethod variant in funding_common.rs, wiring both identity screens through the existing FundWithWallet path, and the user-stories IDN-014 flip. References TC-QRFUND-01..17. No upstream/backend/TaskError changes in scope. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXL4vmWNA1AjUeDVu2EqWA
Restores IDN-014: fund a new identity or a top-up by receiving a Dash deposit to a shown address/QR, routed through the existing FundWithWallet -> AssetLockFunding::FromWalletBalance path. No upstream platform-wallet change, no new BackendTask/WalletTask or TaskError variant. - funding_common: add FundingMethod::ReceiveDeposit with jargon-free labels, plus pure, unit-tested helpers deposit_matches (single-address equality) and deposit_step_after_utxo (waiting-state guard). - add_new_identity_screen + top_up_identity_screen: new "Receive a new deposit" chooser option -> GenerateReceiveAddress -> WaitingOnFunds; revived WaitingOnFunds/FundsReceived flow with QR, address + copy, minimum hint, running-total line, and a never-trap "choose a different funding method" affordance. Confirm reuses the wallet-balance dispatch. - docs/user-stories.md: flip IDN-014 to [Implemented]. Tests: 24 funding_common unit tests (TC-QRFUND-02..08, 16); state-machine detection is verified through the extracted pure helpers since the kittest harness cannot inject task results. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address pre-merge QA findings on the restored IDN-014 funding method: - Smythe LOW-1: on a malformed derived deposit address, surface a MessageBanner error and stop the QR view's infinite re-queue via a new funding_address_request_failed flag; the view offers a "Try again" affordance instead of spinning forever. - Smythe INFO-1: deposit_matches sums attacker-influenced Core output values with saturating_add instead of plain sum (defense in depth). - Adams DOC-2: the minimum-amount hint and the dash: URI now share one round_up_dash_4dp value, so they never disagree or understate the minimum (rounds up to the URI's 4-decimal precision). Unit-tested. - Adams DEDUP-2: reset_to_choose_funding on both screens now sources its (method, step) from default_funding_state(false) instead of hand-writing the tuple. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
Manual GUI verification — live Testnet (functional + UX)Ran the real end-to-end flow against Testnet with a fresh empty wallet and faucet-funded deposits sent to the exact address DET showed. Detection was near-instant (SPV synced to tip); asset-lock proof arrived via InstantLock in ~1s. Functional results
The core flow works and completes reliably on both screens. Issues found (ranked)🟠 #1 [Medium] Funding amount is NOT pre-filled — contradicts this PR's description & TC-QRFUND-08. 🟠 #2 [Medium] "Received X so far" shows whole-wallet balance, not the amount at the shown address.
…which already exceeds the stated minimum yet stays waiting → reads as stuck/broken. Reproduced on Create too. (Empty-wallet first-identity — the gap this PR fills — is unaffected: spendable=0 shows the correct "Waiting for your deposit…" copy.) Fix: sum the deposit received at 🟡 #3 [Low] Stale red error during WaitingForAssetLock. After clicking Create, the amount field stays visible and turns red "Amount 0.99759 DASH exceeds maximum 0…" (spendable now committed to the asset lock → max recomputes to 0), i.e. an error message during a successful in-progress operation. Fix: hide/freeze the amount input once funding is dispatched. PositivesProgressive disclosure is excellent — an empty wallet shows only "Receive a new deposit", exactly the gap this PR targets. QR legible; copy correct & discoverable; waiting copy is calm; never-trap works on every sub-state; create↔top-up parity is solid. Not verified liveBelow-minimum "stays waiting" with a real sub-minimum deposit, multi-partial accumulation at the shown address (both tied to #2's display source), and the address-parse-failure path (faucet sends a fixed 1.0 tDASH; can't force sub-minimum or a derivation failure). Full report + 12 annotated screenshots archived on the maintainer's LAN. 🤖 Generated with Claude Code |
…le error
Three functional bugs a live testnet GUI test found (unit tests + review
missed them — the display_task_result-level integration gap we accepted):
- Bug 1 (amount not pre-filled): on reaching FundsReceived the amount field
stayed empty and the Create/Top-Up button never appeared until the user
typed or clicked Max — contradicting the PR body and TC-QRFUND-08. On the
deposit-arrival transition, pre-fill the fee-reserve-capped balance so the
amount and confirm button populate immediately, still editable.
- Bug 2 ("received so far" showed whole-wallet balance): the running total
read snapshot spendable, so leftover change made it read "Received X …
waiting for Y" while already past the minimum — looked stuck. Now
accumulate the amount received at the shown funding_address (via
deposit_matches) and display that per-address total.
- Bug 3 (stale validation error): the amount input kept rendering during
WaitingForAssetLock, and its max recomputed to 0 once spendable was
committed to the pending tx, showing a red "exceeds maximum 0" over a
succeeding operation. Render the input only in FundsReceived.
Extract deposit_event_outcome (step + pre-fill amount) so the pre-fill
decision is unit-tested; both screens route through it. Adds three
funding_common tests asserting a sufficient deposit advances AND yields a
non-zero pre-fill (the bug-1 regression guard), and that sub-minimum /
wrong-address deposits neither advance nor pre-fill.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Live testnet GUI re-verification — all three fixes PASS ✅Re-ran the Create-Identity and Top-Up QR/receive-deposit flows end-to-end on Testnet against HEAD Screenshots (LAN):
Core flow (regression check): QR renders and is legible; Copy-address is byte-for-byte correct (verified via clipboard); deposit detection is near-instant (seconds); both flows complete fully — Create registered a new identity ( Verdict: ready to un-draft. All three fixes confirmed on live testnet; no regressions in the core flow.
🤖 Generated with Claude Code |
…e-qr-identity-funding
f8c7174
into
docs/platform-wallet-migration-design
Why this PR exists
RegisterIdentityFundingMethod::FundWithUtxo/TopUpIdentityFundingMethod::FundWithUtxo), documented as removed indocs/user-stories.mdstoryIDN-014. The original removal rationale assumed the capability required an upstream API that doesn't exist. That assumption was wrong.docs/platform-wallet-migration-design) — targets that branch, notv1.0-dev, since feat: rewrite Dash Evo Tool onto the new platform-wallet #860 hasn't merged yet.What was done
docs/ai-design/2026-07-10-qr-deposit-funding/) that the old "external" funding was never a foreign/untracked outpoint — it was always the wallet's own SPV-watched receive address, shown as a QR. Restoring it needs zero upstreamplatform-walletchanges and zero newBackendTask/WalletTask/TaskErrorvariants — it routes through the exact sameFundWithWallet→AssetLockFunding::FromWalletBalancepath the existing "fund from wallet balance" method already uses.FundingMethod::ReceiveDepositto both the Create-Identity and Top-Up screens: generates a receive address, shows it as a QR + copyable text + minimum-amount hint, detects a deposit via single-address equality (not wallet-wide membership — a deliberate correction caught during test-spec review), accumulates partial deposits, pre-fills the funding amount (fee-reserve capped, editable) once the minimum is covered, then continues through the existing wallet-balance funding flow unchanged.WalletFundedScreenStepstates (WaitingOnFunds,FundsReceived) left over from the original removal.docs/user-stories.mdIDN-014flipped from[Removed — upstream-only funding]to[Implemented].saturating_add); aligned the displayed minimum-amount hint with the QR URI's rounded value; minor dedup cleanup.Testing
cargo clippy -p dash-evo-tool --all-features --all-targets -- -D warnings— clean.cargo test/nextest -p dash-evo-tool --all-features(identity screens scope) — 29 passed, 0 failed.cargo +nightly fmt --check— clean.display_task_result-level integration tests for the full happy-path state progression and the FundsReceived-path amount pre-fill were not added — building a fullAppContexttest harness for this was judged disproportionate to this PR's scope. The risky logic (address-matching, accumulation, never-trap, method parity) is unit-tested directly via extracted pure helpers. This gap is instead covered by a manual GUI pass against live testnet (in progress) exercising the real end-to-end flow with funded deposits.Breaking changes
None. Purely additive: a new funding-method option alongside the three that already exist; no schema, backend task, or upstream dependency changes.
Checklist
cargo build/cargo clippy --all-features --all-targets -- -D warningscleancargo +nightly fmt --all -- --checkcleandocs/user-stories.mdupdatedAttribution
🤖 Co-authored by Claudius the Magnificent AI Agent