Repository navigation
Extract wallet_core package with shared models, utils and translations - #732
Conversation
First step toward the desktop app: move platform-neutral code out of mobile-app so a desktop package can share it. - New wallet_core package with an architecture test that rejects mobile-only plugins (Firebase, local_auth, live activities, ...) and app-package imports - Move models/, account_utils, miner_stats_csv, provider_reader and the l10n ARB/generated files (with their tests) into wallet_core - Export quantusPrint from quantus_sdk and delete mobile's duplicate - Register wallet_core in melos and CI; document translations in AGENTS.md No behaviour change: mobile 719 + wallet_core 13 tests cover the previous 730; analyze clean across all packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n13
left a comment
There was a problem hiding this comment.
Verdict: Approve
Reviewer: GPT-6.1 Sol
Reviewed head 03741b7b08bdb31b68661bcb10e0c97ec91ea939 against base a8f1661dde9df650714e59c54b5c5fd578e6d4d1. No blocking findings.
The extraction preserves the moved model, utility, localization, and test bodies. Existing Dart changes are import/export updates, and the deleted quantusPrint implementation is identical to the SDK implementation now exported. Callers consistently use the new package paths, localization delegates remain connected, and all 150 resolutions in the new lockfile match the mobile baseline.
Validation:
- Inspected the full diff and checked internal import targets and references to removed paths; no broken references found.
git diff --checkpassed. The non-writing workspace formatter check reported no changes, with unresolved lint-include warnings because package bootstrap was incomplete.- GitHub CI at the reviewed head passed bootstrap, formatting, analysis across all five packages, and tests: wallet_core 13, mobile 719, SDK 678 (1 skipped), cold wallet 459. Dependency cooldown also passed.
Local runtime tests and analysis were blocked by the installed Flutter 3.44.4 versus the repository's pinned 3.47.7: locked offline bootstrap rejected SDK-dependent resolutions. Lockfiles and PR code were left unchanged.
|
LGTM Would just want to know what is the difference between sdk and wallet_core now? What's their respective functions? Meaning why not put wallet core into sdk? Also another question about the architecture is whether these mobile and desktop functions have enough overlap to use the same codebase - I think they do... In short, would like this answered:
We're also sunsetting the GUI miner but it's good to keep these things in separate PRs - I like that this PR just moves files around without changes, makes it easier to track what happened later |
|
Claude said this, Short version: quantus_sdk is what talking to Quantus requires. wallet_core is how our hot wallet behaves. The two apps are views on top of wallet_core. Why not put wallet_core in the SDK?
Is there enough overlap to share code? Yes, and that's why wallet_core exists. Everything except the UI and the platform integrations is the same: accounts, sending, history, multisig, swap, polling and translations. Roughly 10k lines of Dart logic plus the whole Rust core are shared. Only the screens differ, because a phone-style stacked UI feels wrong on desktop and the macOS guidelines expect a sidebar, a menu bar and shortcuts. Where the two apps need the same capability done differently, like push notifications, wallet_core defines an interface and each app provides its own implementation (Firebase on mobile, nothing on desktop for now). |
|
Yes sounds good. LGTM! |
…into beast/make-wallet-core-package
Summary
First step toward the desktop app. This adds a
wallet_corepackage for platform-neutral code shared by mobile and desktop, and moves the leaf pieces (models, small utils, translations) into it. No behaviour change.Phase 1 plan:
wallet_core; move models, leaf utils and l10n.AGENTS.mdrules forwallet_core.Changes
wallet_corepackagetest/architecture_test.dart, which fails iflib/imports, orpubspec.yamldeclares, a mobile-only package orresonance_network_wallet. Mobile-only here means Firebase,local_auth,mobile_scanner,image_picker,app_links,flutter_local_notifications,swap_live_activity_channelandplay_install_referrer.pubspec.lockis seeded from mobile's, so all 150 packages are at the versions mobile already uses.mobile-appwithgit mv, so history follows:lib/models/(12 files) →wallet_core/lib/models/shared/utils/{account_utils,miner_stats_csv,provider_reader}.dart→wallet_core/lib/utils/lib/l10n/andl10n.yaml→wallet_core/. Regenerating withflutter gen-l10nthere gives no diff.quantusPrint:quantus_sdknow exports its existing copy. The identical copy inmobile-app/lib/shared/utils/print.dartis deleted and its 75 importers updated.mobile-app/pubspec.yaml: depends onwallet_core. It dropsflutter_localizationsandgenerate: true, which mobile no longer uses directly.wallet_coreis added tomelos.yaml(package list, path override,testscript) and gets a "Test Wallet Core" step inci.yaml.AGENTS.md: listswallet_coreand adds a Translations section saying where the ARB files live and how to regenerate them.Verification
mobile-app:flutter testgives 719 passed. With the 11 tests moved towallet_core, that's the 730 from the baseline before this change.wallet_core:flutter testgives 13 passed. The architecture test was checked against a temporary Firebase import and a temporarylocal_authdependency, and failed on both.quantus_sdk:flutter test --exclude-tags=nativegives 678 passed, 1 skipped.melos run analyze: no issues in any of the 5 packages.dart format: no changes.melos bootstrap: succeeds and leaves the lockfiles andpubspec_overrides.yamlfiles unchanged. Lockfile changes in this PR:mobile-app/pubspec.lockgainswallet_coreandflutter_localizationsbecomes transitive. No version changes.🤖 Generated with Claude Code