Skip to content

Fix warnings - #4

Merged
QuantumExplorer merged 5 commits into
developfrom
fix/warnings
Nov 16, 2018
Merged

QuantumExplorer merged 5 commits into
developfrom
fix/warnings

Conversation

@podkovyrin

@podkovyrin podkovyrin commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor

depends on dashpay/dashsync-iOS#44
contains changes from #3

@podkovyrin podkovyrin changed the title Fix/warnings Fix warnings Nov 15, 2018
@QuantumExplorer
QuantumExplorer merged commit 2a0f4fe into develop Nov 16, 2018
@QuantumExplorer
QuantumExplorer deleted the fix/warnings branch November 16, 2018 01:25
llbartekll added a commit that referenced this pull request Apr 7, 2026
Stage 2 of #4 mnemonic validation: the parallel `[DSBIP39Mnemonic
phraseIsValid:]` call and the mismatch logger are removed after a manual
smoke test in the Restore Wallet flow produced zero warnings against a
known-good 12-word phrase. The adapter is now ~15 lines of pure
SwiftDashSDK and matches the canonical Stage-2 shape from
`SwiftDashSDKAddressValidator.swift`.

Both implementations follow the BIP-39 RFC against the same 2048-word
English wordlist, so divergence would be a real bug in one side rather
than an edge case to design around — matching the verify-before-assume
lesson from the address-validator devnet episode.

Updates `DASHSYNC_MIGRATION.md` row #4 and the "Where we are" entry to
🌘 Solo. Sister `DSBIP39Mnemonic` wrappers (`cleanupPhrase:`,
`normalizePhrase:`, `wordIsLocal:`, `wordIsValid:`) have no SwiftDashSDK
equivalents in current `Mnemonic.swift` and remain on DashSync.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
llbartekll added a commit that referenced this pull request May 14, 2026
Migration row #4 sat at 🌘 Solo with a dedicated infra-layer @objc
adapter (`DWSwiftDashSDKMnemonicValidator`) whose entire job was to let
Obj-C `DWRecoverModel.phraseIsValid:` reach SwiftDashSDK's Swift-only
`Mnemonic.validate(_:)`. Localize the bridge onto its only consumer
and delete the standalone adapter.

- Delete `SwiftDashSDKMnemonicValidator.swift`.
- Add `DWRecoverModel+Mnemonic.swift` — Swift extension on
  `DWRecoverModel` exposing `@objc(phraseIsValid:)` that calls
  `Mnemonic.validate` directly. The auto-generated
  `dashwallet-Swift.h` carries the selector to Obj-C callers, so
  `DWRecoverContentView.m:219` continues to work unchanged.
- Drop the now-duplicate `phraseIsValid:` declaration from
  `DWRecoverModel.h` and the forwarding body from `DWRecoverModel.m`.
  Sister `DSBIP39Mnemonic` wrappers (`cleanupPhrase:`,
  `normalizePhrase:`, `wordIsLocal:`, `wordIsValid:`) have no
  SwiftDashSDK equivalents and stay on DashSync — unchanged.
- Swap the file references in the Xcode project (build files, file
  reference, group entry moves from the SwiftDashSDK group to
  RecoverWallet, two source-build-phase entries).
- Mark `DASHSYNC_MIGRATION.md` row #4 ✅ Done in both the
  "Where we are" body and the functional table.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
QuantumExplorer added a commit that referenced this pull request Aug 7, 2026
#922)

* fix(masternode-keys): read owner/voting addresses from the live pool

The Masternode Keys screens capped Owner and Voting at 5 keys while
Operator showed 20, on a wallet whose live pools hold 25 entries with
20/17 marked used.

`MasternodeProviderKeyDeriver.address(at:)` resolved addresses from
`SwiftDashSDKHost.derivationWallet()` — a throwaway key-wallet stack
built from the mnemonic purely for private-key derivation. That
instance never processes transactions, so its provider pools sit at the
freshly-created `DEFAULT_SPECIAL_GAP_LIMIT` (5) depth forever, and
every index past 4 resolved to nil.

Both consumers of that address lookup are address JOINS (the overview's
`MasternodeKeyUsage` and `MasternodesScreen`'s ownership labels), and
each skips an index whose address is nil — so masternodes whose
owner/voting key sits deeper than #4 were silently invisible. Operator
and Evonode escaped it because Rust resolves their indexes directly on
the aggregation row rather than joining on an address.

Now the addresses come from the running `PlatformWalletManager`
(`accountAddressPools`) — the pool SPV extends as ProRegTx /
ProUpRegTx matches mark deeper indexes used, and the same data the
Storage Explorer renders. The whole pool is snapshotted once per
deriver, so per-index lookups became dictionary hits instead of an FFI
call each.

The fixed 20-index scan windows are replaced by the live pool's actual
depth (the 20 remains only as a fallback when it can't be read), since
a pool that grows past 20 would otherwise hit the same silent cap.

Private-key derivation (`wif` / `privateKeyHex`) still uses the
derivation wallet — it needs the mnemonic and derives at any index.

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

* fix(masternode-keys): make the pool fallback actually resolve addresses

Review follow-up. The fallback window was inert: when the live-pool read
returned an empty map, `highestAddressIndex` was nil, so the loops fell
back to a fixed 20-index scan in which `address(at:)` returned nil for
every index — a fallback that could not restore a single label.

Now the deriver falls back to the derivation wallet's own provider pool
when the running wallet can't vend the account (e.g. a just-imported
wallet whose registration hasn't completed). That pool is only
gap-limit deep, which is exactly the shallowness the live read exists to
avoid, so it is documented as degraded rather than equivalent — but it
resolves real addresses instead of nothing.

With bounds always derived from a real snapshot, the phantom
`fallbackScanWindow` constants are removed from both call sites; an
unreadable pool now yields an empty range, which is the honest
behaviour: no pool means no addresses to join against.

Also renames the private `masterPath` property to `accountRootPath`
(SwiftLint `inclusive_language`, default-enabled and not disabled in
`.swiftlint.yml`). The SDK's own `masterPath:` argument label is
external API and unchanged.

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

---------

Co-authored-by: Claude Fable 5 <[email protected]>
aliblik pushed a commit to aliblik/dashwallet-ios that referenced this pull request Nov 28, 2026
Route DWRecoverModel's cleanupPhrase/normalizePhrase/wordIsLocal/wordIsValid through SwiftDashSDK.Mnemonic via the DWRecoverModel+Mnemonic.swift @objc extension; remove the DSBIP39Mnemonic-backed ObjC bodies and .h decls and reroute the direct call in DWRecoverContentView.m. Completes migration row dashpay#4's sister methods; only phrase-repair (DWPhraseRepairViewController) stays on DashSync. Updates DASHSYNC_MIGRATION.md.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
aliblik pushed a commit to aliblik/dashwallet-ios that referenced this pull request Nov 28, 2026
Row dashpay#4 stated "8 Rust unit tests"; the committed total was 14 and is now
18 after the follow-up coverage. Update the count and short description.

Co-Authored-By: Claude Opus 4.8 <[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