Fix bitcode support in bls-signatures-pod - #6
Merged
Conversation
podkovyrin
force-pushed
the
fix/bls-bitcode
branch
from
November 19, 2018 10:50
d9a1e58 to
1dc942c
Compare
llbartekll
added a commit
that referenced
this pull request
Apr 9, 2026
M6 stopped DashSync's SPV but left BalanceModel reading from DSWallet.balance, which is now frozen at whatever DashSync had cached the moment M6 ran. This commit unfreezes the home screen balance by sourcing it from SwiftDashSDK via a new SwiftDashSDKWalletState singleton. A new SwiftDashSDKWalletState class is the right home for wallet-side @published state: SPV chain sync (handled by SwiftDashSDKSPVCoordinator) and wallet state (balance, transactions, addresses) are different concerns even though the FFI couples their event delivery. Future follow-ups for transactions (#6), addresses (#1), and identities (#16) will live alongside `balance` in this class instead of bloating the SPV coordinator. - Add SwiftDashSDKWalletState singleton with @published var balance, applyBalance(_:), seedInitialBalance(walletManager:walletId:), and clearBalance() methods. Holds the WalletBalance struct (4 UInt64 fields, with `total` and `spendable` computed). 💰 WALLET :: log tag. - SwiftDashSDKSPVCoordinator: WalletEventsHandler.onBalanceUpdated becomes a thin forwarder to SwiftDashSDKWalletState.shared.applyBalance. performStart calls SwiftDashSDKWalletState.shared.seedInitialBalance after walletManager.importWallet succeeds. Coordinator no longer owns any wallet-side @published state. - BalanceModel subscribes to SwiftDashSDKWalletState.shared.\$balance via Combine and reads from .balance?.total instead of DWEnvironment.sharedInstance().currentWallet.balance. - SwiftDashSDKWalletWiper calls SwiftDashSDKWalletState.shared.clearBalance() after the SwiftData wipe so post-wipe state doesn't show the previous wallet's balance. - Register the new file in both dashwallet and dashpay targets in project.pbxproj (UUID family A5D5DD000000000000010C/D/E). Other DashSync balance consumers (BalanceNotifier, SendAmountModel, DWPhoneWCSessionManager, DashPay/CrowdNode/CoinJoin/DashSpendPay) still read from DSWallet and remain stale. Each gets its own follow-up commit. Aim of this commit is the smallest change that fixes the most visible part of the M6 regression — the home screen number — with the right architectural shape so #6 and beyond can build on it cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Apr 9, 2026
Brings DASHSYNC_MIGRATION.md in line with what's actually shipped: - Add "Where we are" entries for #5 wallet balance (commits 2b447fc, f1b481b, 7c00be4) and #11 SPV chain sync via M5 + M6 (3cf5962 + 86ed727). - Update #14 wipe entry to mention the post-#5 SPV stop + clearBalance calls. - Flip Status column for rows #5 and #11 from `—` to `🌗 Flipped`. - Update file paths and storage notes in rows #5/#6/#7/#11 to reflect the actual code locations and migration story. - Drop the Core Data → SwiftData migrator from Hard Blockers. After the #5 work landed, the migrator turned out unnecessary: chain-derived data (UTXOs, tx history, masternode list, sync state) is re-derivable via SPV resync from SwiftDashSDK's own on-disk chain data. User-entered metadata (tx categories, tax categories, gift card receipts, address labels) was never in DashSync's Core Data — it lives in dashwallet's own SQLite via TransactionMetadataDAOImpl and AddressUserInfo, keyed by txHash / address, so it stays attached after resync automatically. - Rewrite the "Storage migration" section with the corrected picture (no migrator required). - Rework the "Recommended order" wave structure: the chain + balance push (Wave 2 now) ran ahead of DashPay/Platform work because the storage groundwork was unblocked. Tx history (Wave 4 now) is the next big wave and follows the same shape as #5. No code changes — doc only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Apr 10, 2026
M6 stopped DashSync's chain sync, which froze the home screen transaction list at whatever was cached at the moment of the cutover. This commit unfreezes it by sourcing the tx list purely from SwiftDashSDK, following the same pattern as function #5 wallet balance. Pure SwiftDashSDK source — DashSync dropped entirely for the tx list path. On cold launch, the list starts empty and fills progressively as SPV replays blocks from cached chain data. After a full sync, all historical transactions are visible. The tx detail screen opens for all txs but shows reduced info because WalletTransaction only has basic fields (txid, netAmount, height, timestamp, fee). Input/output addresses, instant-send flags, and account-validity state are not available from the SDK yet — those sections are hidden/empty. - Add SwiftDashSDKWalletState.transactions @published, applyTransactions, seedTransactions, clearTransactions. Same pattern as the balance plumbing. Includes @objc bridge notification. - SwiftDashSDKSPVCoordinator wires onTransactionReceived to re-fetch and forward via DispatchQueue.global to avoid re-entering the FFI from within the callback (the SPV client holds a Rust lock during callback dispatch; calling getWalletManager synchronously causes a Rust panic). performStart calls seedTransactions after wallet import. - Transaction.swift becomes a sum type backed by either DSTransaction (existing rich path for other consumers) or WalletTransaction (new SDK path for the home screen). var isMinimal: Bool flag indicates the SDK path. Properties exclusive to DSTransaction return empty/default values for the .sdk case. - HomeViewModel switches TransactionSource to SwiftDashSDKWalletSource reading purely from SwiftDashSDKWalletState.shared.transactions. Subscribes to \$transactions via Combine. CrowdNode/CoinJoin grouping disabled for SDK-sourced txs (matchers need DSTransaction). - TxDetailModel gracefully handles optional transaction.tx via optional chaining — shows available fields, hides unavailable. - SwiftDashSDKWalletWiper clears transactions alongside balance. - StubTransactionSource and Taxes.swift adapted to new Transaction sum type (optional DSTransaction? accessor). Out of scope: rich tx detail (waiting on SDK enrichment), 7 other wallet.allTransactions consumers, CrowdNode/CoinJoin grouping. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Apr 10, 2026
Updates Transaction.swift and SPVCoordinator to use the enriched
WalletTransaction fields exposed by the swift-sdk (platform commit
61b4cb24a). The tx detail screen now shows direction from the FFI
(incoming/outgoing/internal/coinJoin), transaction type labels
(standard/coinbase/provider registration/etc.), InstantSend lock
status, and input addresses where available.
- Transaction.swift .sdk branches: direction uses FFI-provided enum
instead of deriving from netAmount sign; txType maps to the full
Transaction.Type enum; state checks instantSendLocked; input/output
addresses read from wtx.inputs/wtx.outputs.
- SwiftDashSDKSPVCoordinator: onTransactionReceived updated to match
new SPVWalletEventsHandler protocol signature (NotOwnedTransactionRecord
instead of individual parameters).
Note: output addresses are still empty because FFIOutputDetail only
has { index, role }, not address/amount. Input addresses are populated
from FFIInputDetail. Upstream rust-dashcore change needed to add
address field to FFIOutputDetail for full "Received at" display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Apr 13, 2026
Add "Where we are" entry for #6 with commit history and current state (pure SwiftDashSDK source, sum-type Transaction.swift, detail screen with reduced info pending rust-dashcore PR #640 for output addresses). Update table row #6 Status from — to 🌗 Flipped. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
May 14, 2026
The `transactions` @published array and its `applyTransactions` / `seedTransactions` / `currentTransactionCount` / `clearTransactions` helpers were left dangling when upstream gated `managed_core_account_get_transactions` behind the `keep-finalized-transactions` Cargo feature. With no live producer for the bridge, `HomeViewModel` already reads `PersistentTransaction` rows directly from SwiftData via `SwiftDashSDKWalletSource`. Drop the unreachable state and its `transactionsDidChangeNotification`. `DWReceiveModel` was the only external observer of that notification; point it at `NSManagedObjectContextDidSaveNotification` instead — the same SwiftData "tx written" signal HomeViewModel uses — so the displayed receive address advances when SPV processes a payment. Balance state on `SwiftDashSDKWalletState` is untouched. Refresh DASHSYNC_MIGRATION.md rows #1 / #6 / table row 6 to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Jul 2, 2026
SwiftDashSDKReceiveAddressReader ignored its DSChain argument (it resolves the wallet via SwiftDashSDKHost.shared), so every call site fetched DWEnvironment.currentChain / account.wallet.chain purely to feed a discarded value. Drop the parameter: receiveAddress(on:) -> receiveAddress(), @objc(receiveAddressOnChain:) -> plain @objc (auto selector `receiveAddress`). - 10 Swift sites + the BIP70 provider drop the arg; 8 shed a now-dead `let chain` binding. - 5 ObjC sites become a selector swap; DWURLRequestHandler sheds a dead `account` local. Sites that still need chain/account for DSPaymentRequest / Apple Watch balance keep them (those belong to #22 / #5-#6). - The reader file is now completely DashSync-free (zero DS* symbols); kept as a permanent SDK-only helper (same shape as #2 / #21). Flips migration item #1 (receive address) from Solo to Done. dashpay scheme builds clean on iPhone 17 sim (arm64). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Jul 6, 2026
New "Where we are" entry for the five reader groups moved off DSWallet.allTransactions (tax CSV, ZenLedger, gift-card details, CrowdNode withdrawal limits + online-account scans, request-amount receive); #6-satellites deferred list and the #11 audit-correction reader inventory updated — the deprecated DSTransaction filter adapter is gone and the only remaining allTransactions consumers are the DashPay profile data source (#18) and the onboarding stub. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Jul 6, 2026
…e the ledger DWUserProfileDataSourceObject's MOCK_DASHPAY block scanned DSWallet.allTransactions for a faucet-address match — the list is empty post-M6, so the loop never found anything and the existing nil-transaction date fallback already rendered. Behavior-identical deletion; the app now enumerates DashSync's tx store nowhere (the onboarding StubTransactionSource fake is the only remaining allTransactions surface). The file's DWEnvironment import went with it. Ledger: rows #6/#11/satellite and the Notes blocker list still claimed the satellite readers (tax CSV, ZenLedger, gift card, CrowdNode limits, request-amount receive) were on DashSync — all five ported to SDK rows earlier today (4723a7b → 421cff3). Also records the sync-notification re-emit removal (dae5239) under row #11's migration hazard (a). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Jul 6, 2026
C2 PR C — fixes teardown Bug #6: the screen shown after every send wrapped a fresh DSTransaction shell and derived state/date/amount through the frozen DashSync chain/account. - TxDetailModel's @objc convenience init becomes the resolver seam: fetch the persisted PersistentTransaction row by wire txid; for a just-broadcast send the Rust persister hasn't written yet, fall back to a synthetic snapshot seeded from the recent-sends registry (exact amount/fee/recipient/broadcast time, "Sending" state); the last-resort minimal synthetic renders only the courier's identity. Both ObjC success paths (DWBasePayViewController, the DashPay profile popup) resolve through it without any ObjC changes; MainTabbarController uses the same init. The @objc delegate chains (DWPaymentProcessorDelegate → … → PaymentsViewControllerDelegate) keep carrying the DSTransaction courier — they cannot carry the Swift-only Transaction type while DWBasePayViewController.m conforms; they fall with the C8 processor rewrite. - RecentSendsRegistry (owned by WalletSendService.shared): wire-order txid → (address, amount, fee, broadcast date); NSLock-guarded, oldest-eviction cap 16. Writers reverse the senders' display-order hashes: PreparedStandardSend.broadcast(), the selected-input send branch (stop discarding the fee/txHash tuple), the BIP70 interactive L6 exit, and payWithDashUrl (defensive). SendResult carries amount/primaryAddress/txHashDisplay out of the pure BIP70 layer, which stays SDK/DW-free. - TXDetailViewController diffable identity fix: .sentFrom([]) and .sentTo([]) hashed identically (Item.== was hashValue equality and empty payloads combined nothing) — a duplicate-identifier crash once both landed in one snapshot, which SDK-sourced sent rows made the norm. Items now compare per-case identity strings, and empty address groups are skipped instead of rendering blank cells. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
llbartekll
added a commit
that referenced
this pull request
Jul 6, 2026
C2 PR F — Transaction is now a single-source SDKSnapshot wrapper. Net -350 lines; ~130 DSTransaction references leave the app's live transaction surface. - Transaction.swift: case ds, the .tx escape hatch, init(transaction:) and computeStateFromDSTransaction (+ its frozen-chain helpers and kConfirmationThreshold) deleted; every property reads the snapshot directly. Zero producers/consumers remained after PRs A/C/D — audit greps for `Transaction(transaction:`, `case .ds` and `.tx` unwraps are all empty. - TxDetailModel: DashPay source/destination-user blocks are constant false + TODO(dashpay-e2e) — behavior-identical, the legacy reads went through the .ds escape hatch (nil for every reachable row); the date row always uses the wrapper's date. - Taxes/Transactions: DSTransaction overloads and their .tx delegation deleted (zero external callers post-PR-A), plus the dead Tx.all AsyncSequence and the DSTransaction.defaultTaxCategory extension (only those overloads called it). - DSTransaction+DashWallet.swift trimmed, not deleted: the @objc date + short/long/ISO8601 formatters survive for the DashPay-frozen ObjC providers (DWTransactionListDataProvider(+Stub) — ISO8601 is a required protocol method; DWUserProfileDataSourceObject reads date). type/outputReceiveAddresses/specialInfoAddresses and the amount formatters had no callers left. The live DSTransactionDirection UI extension moved to TransactionDataItem.swift (the tx-row formatting home). The ObjC twin category (.m) survives — txMinOutputAmount has live Coinbase callers, txHashData serves the remaining delegate-chain couriers. - Ledgers updated: rows #6/#7 → Done, Wave 4 → Done, teardown C2 → closed with the shape deviations recorded (resolver-at-seam instead of a delegate-chain retype; trim instead of file deletion). Still DSTransaction-typed by design: the @objc payment delegate couriers (fall with C8's processor rewrite), the DashPay-frozen surfaces (C10), the watch pipe (D1), and the DSTransactionDirection enum itself (last, app-owned enum). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 3, 2026
romchornyi
pushed a commit
that referenced
this pull request
Aug 3, 2026
Static audit of DashWallet/Sources plus device diagnostics from two users
(testnet iOS 26.5.2 and mainnet iOS 27.0, both 9.0.0 build 13).
Nil / force-unwrap crashes on ordinary paths:
- `stopNetworkMonitoring()` force-unwrapped `reachabilityObserver`, which is
only assigned by `startNetworkMonitoring()`. Six adopters pair start in
`viewDidLoad` with stop in `deinit`, so a controller released before its
view loaded crashed. Now guarded and nilled out.
- Untyped `catch` blocks force-cast to `Coinbase.Error` / `CrowdNode.Error`;
any `URLError` / `CancellationError` from a flaky connection crashed the
Coinbase transfer and CrowdNode flows. Now `as?` with a fallback case.
- `fatalError` on decoded Coinbase amounts, exchange rates, account icon URLs
and Uphold amounts — all server- or user-supplied. They now return a
placeholder or a typed error.
- `CBAccount.send` / `UpholdAmountModel` treated an unbound SDK wallet as
unreachable; it is reachable during network and wallet switches.
- Gift-card amounts went through `UInt64(Double)`, which traps on negative or
non-finite input. Now range-checked via `Decimal`.
Home transaction list:
- `txItems` was read on the view model's worker queue while being written on
main. Every access is now on main, and `TransactionGroup` became a struct so
the array no longer runs ARC on shared class instances.
- Group indexes captured off-main were applied a main-queue turn later without
revalidation, trapping when a full reload replaced the array in between.
Launch and teardown:
- `[DWEnvironment sharedInstance]` materializes DashSync and reconciles the
whole legacy transaction set on main — 1-4s in the diagnostics, against the
launch watchdog budget. The DashSync-touching tail is deferred by one
main-queue turn. Every chain consumer moved with it: deferring
`DWEnvironment` alone let `DWPhoneWCSessionManager`'s background read win the
race and hit DSChain's main-thread assertion.
- `DWCaptureSessionManager` never tore down: teardown was scheduled only when
the session was already running, so the capture session, its device input
and three serial queues leaked for the process lifetime. Teardown is now
unconditional, clears both output delegates, and runs on main so the session
state is single-threaded. A nil capture device (simulator, or a device that
will not vend the camera) is handled instead of raising.
Other:
- `NumberFormatter.inputString(from:and:)` fell through `assertionFailure` to
`fatalError` in Release when the currency symbol could not be located in the
formatted string — locale-dependent, on the amount-keyboard hot path. It now
returns nil, and the separator index is taken after the string it indexes is
rebuilt.
- `ExplorePointOfUseListViewController` inserted rows from pager offsets rather
than the data source, raising NSInternalInconsistencyException when a filter
or search changed the model mid-request.
- `DatabaseConnection` built its store URL with `URL(string:)` on a filesystem
path and passed `absoluteString` to SQLite; `migrateIfNeeded` now reports a
failed open instead of unwrapping nil.
- The three `DispatchSemaphore` bridges into `Task { @mainactor }` refuse to
run on the main thread rather than deadlocking.
- Removed the `CJTEST` debug tags from shipping log lines (guardrail #6).
Not verified by a build: the SwiftDashSDK package in ../platform is on a
feature branch and does not compile, so the app target was never reached.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
depends on dashpay/dashsync-iOS#47