Skip to content

fix(wallet): say funds are still confirming on a Core identity top-up - #1291

Merged
romchornyi merged 2 commits into
developfrom
fix/identity-topup-funds-confirming
Nov 2, 2026
Merged

romchornyi merged 2 commits into
developfrom
fix/identity-topup-funds-confirming

Conversation

@romchornyi

@romchornyi romchornyi commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 by coreTransferFundsMessage with no route cost — the top-up holds nothing back beyond the L1 reserve, so its ceiling stays coreSpendableDuffs, exactly what canContinueToIdentity checks.
  • The three Core routes now share one private 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 DashWalletTests on an iOS simulator against platform 57b5e5fa3a (.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: PooledSendableBalanceTests 70/70.

Breaking Changes

None.

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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

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
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 43 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e9c32e45-6722-4ef0-985f-09aa9701e0d8
Commits

Reviewing files that changed from the base of the PR and between 683f5e1 and 8540260.

Files selected for processing: 1
  • DashWalletTests/PooledSendableBalanceTests.swift

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e50909e1-c2d6-47a7-a2bd-c6007f934a47
Commits

Reviewing files that changed from the base of the PR and between 7bdbb5a and 683f5e1.

Files selected for processing: 2
  • DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferViewModel.swift
  • DashWalletTests/PooledSendableBalanceTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Core-funded transfer validation now uses a shared funds verdict for Core → Shielded, Core → Platform, and identity top-ups. New tests cover identity top-ups when funds are confirming and when the L1 reserve affects the available balance.

Changes: Core transfer validation

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

Possibly related PRs

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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: showing that funds are still confirming for Core identity top-ups.
Docstring Coverage Passed 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. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
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.

Share

@thepastaclaw

thepastaclaw commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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 thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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: low by gpt-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); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 93% left, weekly 100% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer

@romchornyi
romchornyi merged commit 101c71d into develop Nov 2, 2026
7 checks passed
@romchornyi
romchornyi deleted the fix/identity-topup-funds-confirming branch November 2, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Core-funded identity top-up says Insufficient balance while funds are still confirming

2 participants