Skip to content

Fix analyzer warnings - #3

Merged
QuantumExplorer merged 2 commits into
developfrom
fix/analyzer-warnings
Nov 16, 2018
Merged

QuantumExplorer merged 2 commits into
developfrom
fix/analyzer-warnings

Conversation

@podkovyrin

Copy link
Copy Markdown
Contributor

No description provided.

@podkovyrin podkovyrin mentioned this pull request Nov 15, 2018
@QuantumExplorer
QuantumExplorer merged commit c0f7b6c into develop Nov 16, 2018
@QuantumExplorer
QuantumExplorer deleted the fix/analyzer-warnings branch November 16, 2018 01:20
llbartekll added a commit that referenced this pull request Apr 13, 2026
First read-side flip in the migration arc. Settings → View Recovery
Phrase now reads the mnemonic from SwiftDashSDK's WalletStorage
(plain keychain at wallet.mnemonic) via DWSwiftDashSDKMnemonicReader,
with no DashSync fallback for the existing-wallet path.

Upstream WalletStorage.swift gained storeMnemonic/retrieveMnemonic/
deleteMnemonic — plain keychain with kSecAttrAccessibleWhenUnlocked
ThisDeviceOnly, no PIN encryption (parity with DashSync, iOS keychain
is the security boundary). All write-side mirrors updated: creator
stores mnemonic alongside seed, migrator stores it during upgrade,
wiper deletes it. New SwiftDashSDKMnemonicBackfiller runs once at
launch to copy the mnemonic from DashSync's keychain for users who
ran the migrator/creator before this PR.

The onboarding path (just-created wallet) still reads from DashSync
because DashSync generates the mnemonic and the SwiftDashSDK mirror
is async. This will be eliminated when mnemonic generation (#3) flips.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
llbartekll added a commit that referenced this pull request Apr 13, 2026
SwiftDashSDK is now the entropy source for fresh-install wallets.
DWPreviewSeedPhraseModel generates the 12-word mnemonic via
Mnemonic.generate(wordCount: 12) and stores it synchronously in
WalletStorage, then feeds it to DashSync for wallet structure
creation. Display read unified to single SwiftDashSDKMnemonicReader
path for both existing and just-created wallets.

NOT YET BUILD-VERIFIED — upstream SwiftDashSDK has pre-existing FFI
type mismatches unrelated to this change.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
llbartekll added a commit that referenced this pull request Apr 13, 2026
Merges three commits from the migration-235 worktree:
- feat: mirror PIN-change re-encryption into SwiftDashSDK (#10)
- feat: migrate backup seed phrase display to SwiftDashSDK (#13)
- feat: flip mnemonic generation to SwiftDashSDK (#3)

Resolved UUID collisions in pbxproj (remapped 109-114 → 115-121
to avoid overlap with Container/WalletState UUIDs from HEAD).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
llbartekll added a commit that referenced this pull request May 14, 2026
Two more thin @objc → Swift bridges (both Stage-2-Solo-shaped: only
SwiftDashSDK calls, no DashSync) collapsed onto their single Obj-C
consumer. Same template as the prior validator and address-validator
retirements (commits 4f17829 and c5f6787) — but bundled here
because both share one consumer file.

- Delete `SwiftDashSDKMnemonicGenerator.swift` (41-line `@objc`
  adapter calling `Mnemonic.generate(wordCount:)`).
- Delete `SwiftDashSDKMnemonicReader.swift` (36-line `@objc` adapter
  walking `WalletStorage().listWalletIdsWithMnemonic()` +
  `retrieveMnemonic(for:)`).
- Add `DWPreviewSeedPhraseModel+Mnemonic.swift` — Swift extension on
  the consumer model exposing both `@objc(generateAndStoreMnemonic)`
  and `@objc(readStoredMnemonic)` as instance methods. Behavior is
  byte-identical; the OS log category collapses to one
  (`swift-sdk-migration.preview-seed-phrase-model`).
- Swap two call sites in `DWPreviewSeedPhraseModel.m` to call
  `[self ...]` (the file already imports `dashwallet-Swift.h`).
- Swap the file references in the Xcode project (12 entries removed
  for the two adapters, 6 added for the new extension; group entry
  moves from the SwiftDashSDK group to SecureWallet/Seed).
- Update `DASHSYNC_MIGRATION.md` rows #3 and #13 to reference the
  new extension instead of the deleted adapters. Stages stay
  🌗 Flipped — the DashSync write-side mirrors aren't affected by
  this change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
llbartekll added a commit that referenced this pull request Jul 6, 2026
The forward was disabled at TODO(online-account port) because its legacy
validity gate — DashSync account.transactionIsValid — had no SDK
equivalent, and silently re-enabling a money-moving forward without a
gate was the wrong default. The persisted row's context byte is that
gate, and a stronger one: ObservedTransaction.isChainAccepted
(context >= 1 || blockHeight > 0, i.e. IS-locked/mined/chain-locked)
where legacy accepted mempool txs.

The gate lives INSIDE the filter (CoinsToAddressTxFilter gains
requireChainAccepted, checked before any matcher side effects): the
observer's txid dedupe runs after the filters, so a post-match check
would permanently swallow a mempool-first sighting — in-filter, the
same row re-matches once the persister upgrades its context. The wait
in waitForApiAddressConfirmation uses the gated filter for both its
persisted-row scan and the observer await, with a deep firstSeen floor
(unique-per-link filter; safe) so a row that flips to accepted after
the default now-120s window still matches.

The forward itself: a pre-send CrowdNodeAPIConfirmationTxForwarded scan
guards the relaunch double-forward window (restore re-enters
startTrackingConfirmed mid-.confirming), then the send goes through the
existing selected-input path (sendCoins with SingleInputAddressSelector
on the api address, adjustAmountDownwards for fee carve-out, and
sessionAuthSufficient riding an existing auth session per the deposit
precedent). Errors are log-only — the 20s checkAddressStatus web poll
remains the fallback that completes linking (legacy parity); no local
state transition (polling drives .done).

Auth deviation vs legacy, accepted until C7: the old prompt forced
allowBiometric:false; authorizeSend allows biometrics per the user
setting (the biometric spending limit is separately unenforced —
teardown Bug #3). Remaining accepted risk: a crash between broadcast
and SDK persistence could double-send on relaunch (guard is
chain-visibility-based; legacy had the same window; exposure is the
54321-duff confirmation amount).

This also makes the confirmation sheet's copy true again ("we will
automatically ... transfer the same amount"). Closes teardown cluster
C3. Pending live verification: prefs-injected .confirming smoke with a
real send between own wallets (gate flip + forward + relaunch guard).

Co-Authored-By: Claude Fable 5 <[email protected]>
llbartekll added a commit that referenced this pull request Jul 8, 2026
The interactive half: AuthenticationGate stops calling
DSAuthenticationManager and routes through the app-side service, whose
biometric+PIN flow presents an app-owned SwiftUI modal instead of the
pod's DSRequestPinViewController.

- PinPromptView: an alert-style card (title, PIN boxes, Cancel) over a
  dimmed pass-through backdrop with the system numeric keyboard —
  visually matching the pod's DWAlertController prompt so the migration
  is invisible. Lockout renders inline with a live countdown (D-c7-a).
- PinPromptPresenter: presents over the key window's topController()
  from any context (the gate is called from ObjC facades and async
  Swift alike); transparent host so the send screen stays visible; no
  anchor -> resolves .failed immediately rather than hanging.
- AuthenticationService.authenticate(usingBiometrics:spendAmount:):
  biometrics when allowed (and within allowance for a spend), a
  biometric failure zeroes the allowance and falls to the PIN modal,
  PIN success resets it — the spendAmount thread is in place for Bug #3
  (call sites wired in C7.4).
- AuthenticationGate.authenticate gains a defaulted spendAmount param
  (source-compatible for every caller) and awaits the service. Two-way
  didAuthenticate bridge with the pod, both TODO(C7-final), deleted in
  C7.7.

Lockout, per owner decisions surfaced by the smoke:
- Count EVERY wrong attempt (dropped DashSync's identical-PIN dedup,
  which only shielded a fumbling user and made the lock untestable).
- Show the attempts counter only as a warning close to the PERMANENT
  (wipe-only) lock; a wrong PIN below that just shakes; a temporary
  cooldown shows its own countdown, not a counter.

Verified: dashpay arm64-sim build; the interactive send -> PIN modal,
wrong-PIN counter + lockout, and correct-PIN send were smoked on the
testnet sim (owner).

Co-Authored-By: Claude Fable 5 <[email protected]>
llbartekll added a commit that referenced this pull request Jul 8, 2026
…4, Bug #3)

The biometric spending-limit decrement lived only in DashSync's retired
spend path — WalletSendService's AuthenticationGate never consulted
canUseBiometricAuthenticationForAmount, so Face/Touch ID authorized any
amount regardless of the configured limit.

SendAuthorizer.authorizeSend gains a spendAmount and threads it through
the gate to AuthenticationService.authenticate (the policy home, C7.3):
a send over the remaining allowance skips biometrics and requires the
PIN; a biometric-authorized send decrements the allowance; a PIN resets
it. Wired on the standard send path (prepareStandardSendForConfirmation),
the selected-input path, and the CoinJoin sweep — i.e. every real DASH
spend through WalletSendService.

Scoped out by design (documented at the call sites): PlatformSendConfirmScreen
(moves Platform credits, not the duff-denominated limit), BIP70SendAuthorizer
(the amount isn't known until prepareForConfirmation runs after authorize),
and CrowdNode withdraw (an API message, not a wallet spend).

Verified: dashpay arm64-sim build. Runtime limit behaviour (over-limit ->
PIN, decrement, reset) is a manual smoke on a biometric-enabled device.

Co-Authored-By: Claude Fable 5 <[email protected]>
llbartekll added a commit that referenced this pull request Jul 8, 2026
Remove the one-shot DashSync parity assertion (its byte-compat guard is
now redundant — every flow cut over and the pre-C7 DashSync-written PIN
unlocks under the post-cutover build) and its AppDelegate call. Migration
row #28 + teardown C7 marked done (Bugs #2/#3 fixed), both noting the one
deferred tail: the forgot-PIN DSRecoveryViewController (TODO(C7-recovery)).

Verified: dashpay arm64-sim BUILD SUCCEEDED; zero DSAuthenticationManager/
DSBiometricsAuthenticator references in Swift.

Co-Authored-By: Claude Fable 5 <[email protected]>
llbartekll added a commit that referenced this pull request Jul 8, 2026
…7.9)

Close the C7 recovery tail across the migration docs: row #28 and the
inventory row 10 flip to ✅ Done (auth fully off DashSync, both pod auth
classes zero-refs); the teardown plan's C7 section records the C7.9
forgot-PIN port (DWRecoverAction_ResetPin → ChangePin, wallet kept; wipe
only past threshold; enableAuthenticationIfNeeded); Bugs #2 and #3 flip
from "Open — fixed by C7 PRx" to ✅ Fixed (C7.1 / C7.4).

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

2 participants