Skip to content

fix(ui): QR scanner accepts Platform and Shielded addresses - #850

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/qr-all-address-types
Jul 17, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
fix/qr-all-address-types

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

What

The QR scanner only recognized base58 Core addresses — scanning a bech32m Platform (tdash1…/dash1…) or Shielded (0x10 + 43-byte Orchard payload) QR (e.g. the app's own Quick Receive codes) read as an invalid code. Now:

  • Scan gate widened: ParsedPaymentURI gains isAddressPayableForCurrentNetwork — base58 Core OR bech32m Platform/Shielded, all network-checked — and isValidDashPaymentIntent accepts it. The Core-only verdict (isAddressValidForCurrentNetwork) lives on for the BIP70-fallback path.
  • Correct routing: base58 scans keep the classic payment-processor path unchanged. Bech32m destinations can't ride that processor, so the base scan handler (DWBasePayViewController) presents the Send screen prefilled with the scanned address (+ BIP21 amount when present), where the existing route model picks the funding source and executes. Same presentation chrome as the payments landing (hidden-bar nav, full screen, self-drawn header).
  • The Send screen's own in-form scanner needed no change — it already ingests scanned input and benefits automatically once the gate passes these payloads.

Implementation

The wire-form decoder moved from SendViewModel.classify into a shared nonisolated DashAddressClassifier (the scan pipeline classifies on its capture queue, where the @MainActor VM method isn't callable); the VM forwards to it — one decoder, no copies. SendScreenViewController gains an ObjC-visible prefill(address:amountDuffs:) for the scan-routing entry.

Testing

Testnet smoke on QA-iPhone16 / iPhone 16 Pro sims: scanning the app's own Quick Receive QR codes for Platform and Shielded lands in the Send form with the address prefilled and the correct destination badge; base58 Core scans (bare + BIP21 with amount) still route through the classic processor; a wrong-network bech32m QR still reads invalid. Unit-test target pre-existing-broken per CLAUDE.md.

🤖 Generated with Claude Code

The scan gate keyed on base58 Core validity only, so a bech32m Platform
(tdash1…/dash1…) or Shielded (0x10 Orchard payload) QR read as an
invalid code.

- The wire-form decoder moves out of SendViewModel.classify into a
  shared nonisolated DashAddressClassifier (the scanner classifies on
  its capture queue, where the @mainactor VM method isn't callable);
  the VM forwards to it.
- ParsedPaymentURI gains isAddressPayableForCurrentNetwork (base58 Core
  OR bech32m Platform/Shielded, network-checked) and
  isValidDashPaymentIntent accepts it. The Core-only verdict lives on
  for the BIP70-fallback path.
- Bech32m destinations can't ride the classic L1 payment processor, so
  the base scan handler routes them into the Send screen prefilled
  (address + BIP21 amount when present) — its route model handles all
  destination forms. Base58 scans keep the legacy processor path
  unchanged, and the Send screen's own in-form scanner works as-is now
  that the gate passes these payloads through.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cdc8e311-755a-4035-99c7-6ba344d665c8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/qr-all-address-types

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

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer
QuantumExplorer merged commit 6824b52 into swift-sdk-integration Jul 17, 2026
1 check passed
@QuantumExplorer
QuantumExplorer deleted the fix/qr-all-address-types branch August 7, 2026 08:22
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.

1 participant