Repository navigation
fix(ui): QR scanner accepts Platform and Shielded addresses - #850
Merged
Merged
Conversation
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]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:ParsedPaymentURIgainsisAddressPayableForCurrentNetwork— base58 Core OR bech32m Platform/Shielded, all network-checked — andisValidDashPaymentIntentaccepts it. The Core-only verdict (isAddressValidForCurrentNetwork) lives on for the BIP70-fallback path.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).Implementation
The wire-form decoder moved from
SendViewModel.classifyinto a shared nonisolatedDashAddressClassifier(the scan pipeline classifies on its capture queue, where the@MainActorVM method isn't callable); the VM forwards to it — one decoder, no copies.SendScreenViewControllergains an ObjC-visibleprefill(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