Repository navigation
fix(wallet): say funds are still confirming on a Core identity top-up - #1291
Conversation
The Core → Identity top-up on the internal transfer screen still said "Insufficient balance" for an amount that only needs incoming coins to confirm, while Core → Platform with the same amount said "still confirming". The top-up's asset lock is built by the same pooled funding as Core → Platform, so it now gets the same verdict, with no route cost on top of the L1 reserve. The three Core routes share one helper for the live pooled inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qvx8sdEhHcsmPbjRBJ9AKh
|
Warning Review limit reachedYou'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 43 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared route validation DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferViewModel.swift |
A new helper passes the requested amount, route ceiling and cost, cached L1 reserve, and send-pool data to the shared Core funds verdict. Core → Shielded and Core → Platform now use this helper. |
Identity top-up validation DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferViewModel.swift, DashWalletTests/PooledSendableBalanceTests.swift |
Core-funded identity top-ups use the shared verdict with zero route cost. Three tests cover still-confirming and insufficient-balance outcomes for different L1 reserve and unconfirmed-funds conditions. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- Internal transfer Core→Shielded / Core→Platform says "Insufficient balance" while incoming funds are still confirming #1260: The PR extends confirming-funds validation to identity top-ups and shares the route funding calculation with existing Core routes.
- Core-funded identity top-up says Insufficient balance while funds are still confirming #1284: The PR changes Core-funded identity top-ups to show confirming-funds guidance when incoming funds can cover the top-up.
Possibly related PRs
- dashpay/dashwallet-ios#1261: Introduced the shared Core funds verdict and pooled-balance validation used by the routes consolidated in this PR.
- dashpay/dashwallet-ios#1229: Introduced the verdict and reserve logic that this PR applies to Core-funded identity top-ups.
Suggested reviewers: jeanpierreroma, llbartekll
Merge Risk: 
Minimal · previous review 683f5
-
Core-funded identity top-ups can now indicate that funds are still confirming. No material merge risk was identified.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
|
✅ Final review complete — no blockers (commit 8540260) · triage: low |
The first receive into an empty wallet, a shortfall waiting cannot cover, the reserve taking exactly the room left, and an unknown pooled figure next to a pool that would say "still confirming" (the pool must not be read). Amounts are picked so a non-zero route cost would change the verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qvx8sdEhHcsmPbjRBJ9AKh
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the complete base-to-head diff at 8540260 and found no actionable issues: the identity top-up retains its existing affordability ceiling, while the shared helper preserves both existing Core routes and includes the L1 reserve in confirmation guidance. Current exact-head CI reports the simulator tests, test-target membership, accessibility audit, and recovery check passing; no builds or tests were run locally in this static-review lane. The available sibling SDK source corroborates the shared pooled-funding premise, but its checkout differs from .platform-ref, so it is not exact-pin dependency validation.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a small, contained validation-message fix that reuses existing balance arithmetic, consolidates route wiring, and adds edge-case tests without changing funds movement or coin selection. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 93% left, weekly 100% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
Issue being fixed or feature implemented
Closes #1284.
#1229 and #1261 made the internal transfer screen say "X DASH is still confirming" instead of "Insufficient balance" when the amount only needs incoming coins to confirm — for Core → Shielded and Core → Platform. The Core → Identity top-up on the same screen was left on the plain balance check, so with the same amount, switching the destination from Platform to Identity changed the message from "still confirming" to "Insufficient balance".
The top-up's asset lock is built by the same pooled funding pipeline as Core → Platform (
create_funded_asset_lock_proof), so the same verdict applies.What was done?
identityAmountValidationMessage, Core source: judged bycoreTransferFundsMessagewith no route cost — the top-up holds nothing back beyond the L1 reserve, so its ceiling stayscoreSpendableDuffs, exactly whatcanContinueToIdentitychecks.coreRouteFundsMessage(ceilingDuffs:routeCostDuffs:), so the live pooled inputs are wired in one place instead of three.PooledSendableBalanceTests: the shared arithmetic with no route cost, as the top-up uses it — still confirming when the L1 reserve fits or takes exactly the room left, the first receive into an empty wallet, confirmed funds below the L1 reserve; insufficient when the reserve takes the last room, when waiting cannot cover the amount, and while the pooled figure is unknown. The identity minimum, missing-identity and sync gates run before this branch and are unchanged; the instance wiring is not unit-testable without the shared wallet state.Not covered here:
How Has This Been Tested?
Full
DashWalletTestson an iOS simulator against platform57b5e5fa3a(.platform-ref): 1494 tests, 0 unexpected failures (the one known expected failure,String_DashWallet.testAssumptionThatCurrencySymbol…, is unchanged). After the tests added for #1284's coverage list:PooledSendableBalanceTests70/70.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code