Skip to content

feat(setup): phase 1 — project initialization - #50

Merged
grunch merged 3 commits into
mainfrom
004-mostro-p2p-client
Mar 29, 2026
Merged

feat(setup): phase 1 — project initialization#50
grunch merged 3 commits into
mainfrom
004-mostro-p2p-client

Conversation

@grunch

@grunch grunch commented Mar 29, 2026

Copy link
Copy Markdown
Member

Bootstrap monorepo toolchain for 004-mostro-p2p-client:

  • Directory structure: lib/features/ (12 feature dirs), lib/core/, lib/shared/, rust/src/ (7 module stubs), assets/data/, assets/images/
  • rust/Cargo.toml: nostr-sdk 0.44, mostro-core 0.8, flutter_rust_bridge 2.11.1, sqlx, bip32/bip39, chacha20poly1305 with native/WASM feature gates
  • pubspec.yaml v2.0.0+1: flutter_riverpod, go_router, sembast, introduction_screen, flutter_secure_storage, mobile_scanner, qr_flutter
  • Linting: .clippy.toml, strict analysis_options.yaml, .githooks/pre-commit
  • assets/data/fiat.json: 153 ISO 4217 currencies with flag emojis
  • lib/l10n/: skeleton ARB files for EN, ES, IT, FR, DE
  • assets/images/: placeholder walkthrough images wt-1.png through wt-6.png

Checkpoint: flutter pub get, cargo build, flutter analyze all pass.

Summary by CodeRabbit

  • New Features

    • Multi-language UI added (DE, EN, ES, FR, IT) with runtime localization support
    • Built-in fiat currency list for currency selection/display
    • Onboarding screens, QR scanning/display, and file-picking support
  • Chores

    • App version bumped to 2.0.0
    • Development tooling and QA enhancements (pre-commit checks, static analysis)
    • Plugin and asset declarations updated (new assets/images and data file)

Bootstrap monorepo toolchain for 004-mostro-p2p-client:

- Directory structure: lib/features/ (12 feature dirs), lib/core/,
  lib/shared/, rust/src/ (7 module stubs), assets/data/, assets/images/
- rust/Cargo.toml: nostr-sdk 0.44, mostro-core 0.8, flutter_rust_bridge
  2.11.1, sqlx, bip32/bip39, chacha20poly1305 with native/WASM feature gates
- pubspec.yaml v2.0.0+1: flutter_riverpod, go_router, sembast,
  introduction_screen, flutter_secure_storage, mobile_scanner, qr_flutter
- Linting: .clippy.toml, strict analysis_options.yaml, .githooks/pre-commit
- assets/data/fiat.json: 153 ISO 4217 currencies with flag emojis
- lib/l10n/: skeleton ARB files for EN, ES, IT, FR, DE
- assets/images/: placeholder walkthrough images wt-1.png through wt-6.png

Checkpoint: flutter pub get, cargo build, flutter analyze all pass.
@coderabbitai

coderabbitai Bot commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 034f5d80-b4a3-4b72-a95e-e6b3b53a6373

📥 Commits

Reviewing files that changed from the base of the PR and between 0111871 and 029a6dc.

📒 Files selected for processing (2)
  • .githooks/pre-commit
  • assets/data/fiat.json
✅ Files skipped from review due to trivial changes (1)
  • assets/data/fiat.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • .githooks/pre-commit

Walkthrough

Adds project scaffolding: Rust crate and modules, Clippy and pre-commit checks, expanded Flutter deps and assets (fiat.json), multi-language Flutter localizations (DE/EN/ES/FR/IT) with generated delegates/implementations, analyzer/linter tweaks, macOS plugin registration, and task checklist updates.

Changes

Cohort / File(s) Summary
Rust Configuration & Dependencies
rust/Cargo.toml, .clippy.toml
Added comprehensive Rust dependencies (flutter_rust_bridge, nostr-sdk, mostro-core, serde, crypto, bip32/bip39, target-specific sections) and a Clippy config (enum-variant-size-threshold = 200) with CI guidance.
Rust Modules (scaffolding)
rust/src/lib.rs, rust/src/api/mod.rs, rust/src/crypto/mod.rs, rust/src/db/mod.rs, rust/src/mostro/mod.rs, rust/src/nostr/mod.rs, rust/src/nwc/mod.rs, rust/src/queue/mod.rs
Declared seven public modules in lib.rs and added placeholder module files (implementation pending).
Flutter Dependencies & Assets
pubspec.yaml, assets/data/fiat.json, assets/images/...
Bumped app version to 2.0.0+1, added many Flutter packages (flutter_rust_bridge path, riverpod, go_router, sembast, secure storage, shared_preferences, qr, mobile_scanner, file_picker, permission_handler, path_provider), and declared new assets including assets/data/fiat.json.
Localization — Resources
lib/l10n/app_en.arb, lib/l10n/app_de.arb, lib/l10n/app_es.arb, lib/l10n/app_fr.arb, lib/l10n/app_it.arb
Added ARB files for English, German, Spanish, French, and Italian containing translations and metadata (@@locale, @@last_modified, @ descriptions).
Localization — API & Implementations
lib/l10n/app_localizations.dart, lib/l10n/app_localizations_en.dart, lib/l10n/app_localizations_de.dart, lib/l10n/app_localizations_es.dart, lib/l10n/app_localizations_fr.dart, lib/l10n/app_localizations_it.dart
Added AppLocalizations abstraction, delegate, supportedLocales and per-language concrete classes (AppLocalizationsEn/De/Es/Fr/It) with getters for appName, loading, error, cancel, confirm, done, skip.
Tooling & Analysis
.githooks/pre-commit, analysis_options.yaml
Added pre-commit script running tests, cargo clippy -- -D warnings, wasm target check, and flutter analyze; updated analyzer exclude patterns and enabled selected lints.
Platform Integration
macos/Flutter/GeneratedPluginRegistrant.swift
Registered SharedPreferencesPlugin in macOS generated plugin registrant.
Documentation / Specs
specs/004-mostro-p2p-client/tasks.md
Marked Phase 1 tasks T001–T007 as completed.

Sequence Diagram(s)

sequenceDiagram
    participant UI as BuildContext
    participant Localizations as AppLocalizations.of()
    participant Delegate as _AppLocalizationsDelegate
    participant Lookup as lookupAppLocalizations()
    participant Impl as AppLocalizationsEn/De/Es/Fr/It

    UI->>Localizations: AppLocalizations.of(context)
    Localizations->>Delegate: delegate.load(locale)
    Delegate->>Lookup: lookupAppLocalizations(locale)
    alt supported languageCode
        Lookup->>Impl: instantiate concrete locale
        Impl-->>Lookup: return instance
    else unsupported
        Lookup->>Lookup: throw FlutterError
    end
    Lookup-->>Delegate: locale instance
    Delegate-->>Localizations: provide localization
    Localizations-->>UI: localized getters available
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰
I hopped and packed the project neat,
Locales, crates, and assets sweet,
Placeholders whisper, code will sprout—
A tiny rabbit routes the route! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(setup): phase 1 — project initialization' directly and clearly summarizes the main change: establishing the foundational project structure for phase 1 of the 004-mostro-p2p-client initiative, as confirmed by the PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 004-mostro-p2p-client
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch 004-mostro-p2p-client

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
analysis_options.yaml (1)

19-21: Remove the global invalid_annotation_target: ignore and exclude generated l10n files.

The l10n generated code in lib/l10n/ already contains // ignore_for_file: type=lint directives, making the global suppression at Line 21 redundant. Add lib/l10n/** to the analyzer.exclude section instead to maintain clean suppression without masking legitimate annotation errors in hand-written code.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@analysis_options.yaml` around lines 19 - 21, Remove the global suppression by
deleting the "invalid_annotation_target: ignore" entry and instead add the
generated localization folder to the analyzer exclusions by adding "lib/l10n/**"
under the "analyzer.exclude" section so generated l10n files remain ignored
while hand-written code still gets proper annotation diagnostics; update
analysis_options.yaml to remove the global rule and include the
"analyzer.exclude: lib/l10n/**" entry.
rust/src/api/mod.rs (1)

1-1: Add one minimal bridge symbol to crate::api to smoke-test end-to-end binding generation.

rust/src/api/mod.rs is configured as the flutter_rust_bridge.yaml entrypoint (rust_input: "crate::api") but currently exports no public functions or types. Without at least one public API symbol, the bootstrap does not validate that Rust-to-Dart binding generation works. A tiny pub fn ping() or similar would turn the bridge setup into a real smoke test.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rust/src/api/mod.rs` at line 1, Add a minimal public bridge symbol in
crate::api so the flutter_rust_bridge entrypoint validates binding generation:
implement a public function named ping (e.g., pub fn ping() -> String) inside
rust/src/api/mod.rs that returns a small sentinel like "pong" to serve as a
smoke-test for Rust-to-Dart bindings.
rust/src/lib.rs (1)

6-12: Consider reducing early public API surface.
If these modules are internal for now, prefer pub(crate) mod until their external API is intentional and stable.

Suggested refactor
-pub mod api;
-pub mod crypto;
-pub mod db;
-pub mod mostro;
-pub mod nostr;
-pub mod nwc;
-pub mod queue;
+pub(crate) mod api;
+pub(crate) mod crypto;
+pub(crate) mod db;
+pub(crate) mod mostro;
+pub(crate) mod nostr;
+pub(crate) mod nwc;
+pub(crate) mod queue;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rust/src/lib.rs` around lines 6 - 12, The top-level modules (api, crypto, db,
mostro, nostr, nwc, queue) are exported publicly but appear to be internal;
change their declarations from `pub mod` to `pub(crate) mod` (e.g., `pub(crate)
mod api`, `pub(crate) mod db`, etc.) so the crate exposes a smaller, intentional
public API surface; after this change, update any external uses that relied on
these modules (or re-export specific types/functions from lib.rs when you want a
stable public API).
lib/l10n/app_localizations.dart (1)

99-105: Avoid duplicating supported locale definitions.
Line 160 hardcodes language codes already defined in supportedLocales (Line 99). Using one source of truth prevents drift when adding locales.

♻️ Proposed refactor
   `@override`
-  bool isSupported(Locale locale) =>
-      <String>['de', 'en', 'es', 'fr', 'it'].contains(locale.languageCode);
+  bool isSupported(Locale locale) => AppLocalizations.supportedLocales.any(
+        (Locale supportedLocale) =>
+            supportedLocale.languageCode == locale.languageCode,
+      );

Also applies to: 160-161

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/l10n/app_localizations.dart` around lines 99 - 105, There are duplicate
locale definitions: the static const List<Locale> supportedLocales is the source
of truth but the language codes are hardcoded again later; remove the duplicate
hardcoded list and instead derive the language-code list from supportedLocales
(or add a single shared constant like supportedLanguageCodes derived from
supportedLocales) so both places reference the same data; update the other usage
to read from that derived list rather than repeating the literals, keeping
references to supportedLocales (and the new supportedLanguageCodes if you add
it) to locate where to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.githooks/pre-commit:
- Around line 6-10: The pre-commit hook currently runs only linting in the rust
directory (the line with (cd rust && cargo clippy -- -D warnings 2>&1)); add
Rust tests by running cargo test before cargo clippy so regressions are caught
locally. Replace the single clippy invocation with a combined command that runs
cargo test && cargo clippy inside the rust dir (preserving the existing
stdout/stderr redirection and exit behavior) so the hook fails if tests or
clippy fail.

In `@assets/data/fiat.json`:
- Around line 55-121: The fiat.json dataset contains outdated/withdrawn ISO 4217
codes (e.g., "HRK" and "SLL"); update the currency list by replacing deprecated
codes with current ISO 4217 entries from an authoritative source (e.g., ISO or a
maintained central bank/currency registry) and remove legacy entries such as
"HRK" and "SLL" from the array; then add an automated validation step (unit test
or CI check) that loads fiat.json and verifies every "code" value against a
canonical list (a checked-in JSON or a small helper function like
validateCurrencyCodes or a test named test_fiat_codes_are_current) so future
drift is detected and PRs fail when deprecated codes are reintroduced.

In `@rust/Cargo.toml`:
- Around line 39-48: Add an explicit wasm target validation step to the
build/CI: run `cargo check --target wasm32-unknown-unknown` after the native
build to ensure the wasm-specific dependency graph (the
`[target.'cfg(target_arch = "wasm32")'.dependencies]` entries including
`wasm-bindgen-futures`, `indexed_db_futures`, and the wasm `reqwest` feature
set) is exercised and errors surface early; update the project's CI/build script
to invoke this command (or equivalent cargo invocation) so wasm-only resolver
issues are caught before merging.

---

Nitpick comments:
In `@analysis_options.yaml`:
- Around line 19-21: Remove the global suppression by deleting the
"invalid_annotation_target: ignore" entry and instead add the generated
localization folder to the analyzer exclusions by adding "lib/l10n/**" under the
"analyzer.exclude" section so generated l10n files remain ignored while
hand-written code still gets proper annotation diagnostics; update
analysis_options.yaml to remove the global rule and include the
"analyzer.exclude: lib/l10n/**" entry.

In `@lib/l10n/app_localizations.dart`:
- Around line 99-105: There are duplicate locale definitions: the static const
List<Locale> supportedLocales is the source of truth but the language codes are
hardcoded again later; remove the duplicate hardcoded list and instead derive
the language-code list from supportedLocales (or add a single shared constant
like supportedLanguageCodes derived from supportedLocales) so both places
reference the same data; update the other usage to read from that derived list
rather than repeating the literals, keeping references to supportedLocales (and
the new supportedLanguageCodes if you add it) to locate where to change.

In `@rust/src/api/mod.rs`:
- Line 1: Add a minimal public bridge symbol in crate::api so the
flutter_rust_bridge entrypoint validates binding generation: implement a public
function named ping (e.g., pub fn ping() -> String) inside rust/src/api/mod.rs
that returns a small sentinel like "pong" to serve as a smoke-test for
Rust-to-Dart bindings.

In `@rust/src/lib.rs`:
- Around line 6-12: The top-level modules (api, crypto, db, mostro, nostr, nwc,
queue) are exported publicly but appear to be internal; change their
declarations from `pub mod` to `pub(crate) mod` (e.g., `pub(crate) mod api`,
`pub(crate) mod db`, etc.) so the crate exposes a smaller, intentional public
API surface; after this change, update any external uses that relied on these
modules (or re-export specific types/functions from lib.rs when you want a
stable public API).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 473e88c4-4035-4c67-b4bc-e7be40adf968

📥 Commits

Reviewing files that changed from the base of the PR and between 1f3d002 and 0111871.

⛔ Files ignored due to path filters (7)
  • assets/images/wt-1.png is excluded by !**/*.png
  • assets/images/wt-2.png is excluded by !**/*.png
  • assets/images/wt-3.png is excluded by !**/*.png
  • assets/images/wt-4.png is excluded by !**/*.png
  • assets/images/wt-5.png is excluded by !**/*.png
  • assets/images/wt-6.png is excluded by !**/*.png
  • rust/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • .clippy.toml
  • .githooks/pre-commit
  • analysis_options.yaml
  • assets/data/fiat.json
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_localizations.dart
  • lib/l10n/app_localizations_de.dart
  • lib/l10n/app_localizations_en.dart
  • lib/l10n/app_localizations_es.dart
  • lib/l10n/app_localizations_fr.dart
  • lib/l10n/app_localizations_it.dart
  • macos/Flutter/GeneratedPluginRegistrant.swift
  • pubspec.yaml
  • rust/Cargo.toml
  • rust/src/api/mod.rs
  • rust/src/crypto/mod.rs
  • rust/src/db/mod.rs
  • rust/src/lib.rs
  • rust/src/mostro/mod.rs
  • rust/src/nostr/mod.rs
  • rust/src/nwc/mod.rs
  • rust/src/queue/mod.rs
  • specs/004-mostro-p2p-client/tasks.md

Comment thread .githooks/pre-commit
Comment thread assets/data/fiat.json Outdated
Comment on lines +55 to +121
{"code": "HRK", "name": "Croatian Kuna", "flag": "🇭🇷"},
{"code": "HTG", "name": "Haitian Gourde", "flag": "🇭🇹"},
{"code": "HUF", "name": "Hungarian Forint", "flag": "🇭🇺"},
{"code": "IDR", "name": "Indonesian Rupiah", "flag": "🇮🇩"},
{"code": "ILS", "name": "Israeli New Shekel", "flag": "🇮🇱"},
{"code": "INR", "name": "Indian Rupee", "flag": "🇮🇳"},
{"code": "IQD", "name": "Iraqi Dinar", "flag": "🇮🇶"},
{"code": "IRR", "name": "Iranian Rial", "flag": "🇮🇷"},
{"code": "ISK", "name": "Icelandic Króna", "flag": "🇮🇸"},
{"code": "JMD", "name": "Jamaican Dollar", "flag": "🇯🇲"},
{"code": "JOD", "name": "Jordanian Dinar", "flag": "🇯🇴"},
{"code": "JPY", "name": "Japanese Yen", "flag": "🇯🇵"},
{"code": "KES", "name": "Kenyan Shilling", "flag": "🇰🇪"},
{"code": "KGS", "name": "Kyrgystani Som", "flag": "🇰🇬"},
{"code": "KHR", "name": "Cambodian Riel", "flag": "🇰🇭"},
{"code": "KMF", "name": "Comorian Franc", "flag": "🇰🇲"},
{"code": "KPW", "name": "North Korean Won", "flag": "🇰🇵"},
{"code": "KRW", "name": "South Korean Won", "flag": "🇰🇷"},
{"code": "KWD", "name": "Kuwaiti Dinar", "flag": "🇰🇼"},
{"code": "KYD", "name": "Cayman Islands Dollar", "flag": "🇰🇾"},
{"code": "KZT", "name": "Kazakhstani Tenge", "flag": "🇰🇿"},
{"code": "LAK", "name": "Lao Kip", "flag": "🇱🇦"},
{"code": "LBP", "name": "Lebanese Pound", "flag": "🇱🇧"},
{"code": "LKR", "name": "Sri Lankan Rupee", "flag": "🇱🇰"},
{"code": "LRD", "name": "Liberian Dollar", "flag": "🇱🇷"},
{"code": "LSL", "name": "Lesotho Loti", "flag": "🇱🇸"},
{"code": "LYD", "name": "Libyan Dinar", "flag": "🇱🇾"},
{"code": "MAD", "name": "Moroccan Dirham", "flag": "🇲🇦"},
{"code": "MDL", "name": "Moldovan Leu", "flag": "🇲🇩"},
{"code": "MGA", "name": "Malagasy Ariary", "flag": "🇲🇬"},
{"code": "MKD", "name": "Macedonian Denar", "flag": "🇲🇰"},
{"code": "MMK", "name": "Myanmar Kyat", "flag": "🇲🇲"},
{"code": "MNT", "name": "Mongolian Tögrög", "flag": "🇲🇳"},
{"code": "MOP", "name": "Macanese Pataca", "flag": "🇲🇴"},
{"code": "MRU", "name": "Mauritanian Ouguiya", "flag": "🇲🇷"},
{"code": "MUR", "name": "Mauritian Rupee", "flag": "🇲🇺"},
{"code": "MVR", "name": "Maldivian Rufiyaa", "flag": "🇲🇻"},
{"code": "MWK", "name": "Malawian Kwacha", "flag": "🇲🇼"},
{"code": "MXN", "name": "Mexican Peso", "flag": "🇲🇽"},
{"code": "MYR", "name": "Malaysian Ringgit", "flag": "🇲🇾"},
{"code": "MZN", "name": "Mozambican Metical", "flag": "🇲🇿"},
{"code": "NAD", "name": "Namibian Dollar", "flag": "🇳🇦"},
{"code": "NGN", "name": "Nigerian Naira", "flag": "🇳🇬"},
{"code": "NIO", "name": "Nicaraguan Córdoba", "flag": "🇳🇮"},
{"code": "NOK", "name": "Norwegian Krone", "flag": "🇳🇴"},
{"code": "NPR", "name": "Nepalese Rupee", "flag": "🇳🇵"},
{"code": "NZD", "name": "New Zealand Dollar", "flag": "🇳🇿"},
{"code": "OMR", "name": "Omani Rial", "flag": "🇴🇲"},
{"code": "PAB", "name": "Panamanian Balboa", "flag": "🇵🇦"},
{"code": "PEN", "name": "Peruvian Sol", "flag": "🇵🇪"},
{"code": "PGK", "name": "Papua New Guinean Kina", "flag": "🇵🇬"},
{"code": "PHP", "name": "Philippine Peso", "flag": "🇵🇭"},
{"code": "PKR", "name": "Pakistani Rupee", "flag": "🇵🇰"},
{"code": "PLN", "name": "Polish Zloty", "flag": "🇵🇱"},
{"code": "PYG", "name": "Paraguayan Guaraní", "flag": "🇵🇾"},
{"code": "QAR", "name": "Qatari Riyal", "flag": "🇶🇦"},
{"code": "RON", "name": "Romanian Leu", "flag": "🇷🇴"},
{"code": "RSD", "name": "Serbian Dinar", "flag": "🇷🇸"},
{"code": "RUB", "name": "Russian Ruble", "flag": "🇷🇺"},
{"code": "RWF", "name": "Rwandan Franc", "flag": "🇷🇼"},
{"code": "SAR", "name": "Saudi Riyal", "flag": "🇸🇦"},
{"code": "SBD", "name": "Solomon Islands Dollar", "flag": "🇸🇧"},
{"code": "SCR", "name": "Seychellois Rupee", "flag": "🇸🇨"},
{"code": "SDG", "name": "Sudanese Pound", "flag": "🇸🇩"},
{"code": "SEK", "name": "Swedish Krona", "flag": "🇸🇪"},
{"code": "SGD", "name": "Singapore Dollar", "flag": "🇸🇬"},
{"code": "SLL", "name": "Sierra Leonean Leone", "flag": "🇸🇱"},

@coderabbitai coderabbitai Bot Mar 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Currency dataset includes outdated ISO codes.
Line 55 (HRK) and Line 121 (SLL) are legacy codes; keeping withdrawn/replaced entries in a list described as ISO 4217 introduces data correctness risk for selection, validation, and integrations.

Please refresh this file from a current canonical source and add a validation step/test to prevent drift.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/data/fiat.json` around lines 55 - 121, The fiat.json dataset contains
outdated/withdrawn ISO 4217 codes (e.g., "HRK" and "SLL"); update the currency
list by replacing deprecated codes with current ISO 4217 entries from an
authoritative source (e.g., ISO or a maintained central bank/currency registry)
and remove legacy entries such as "HRK" and "SLL" from the array; then add an
automated validation step (unit test or CI check) that loads fiat.json and
verifies every "code" value against a canonical list (a checked-in JSON or a
small helper function like validateCurrencyCodes or a test named
test_fiat_codes_are_current) so future drift is detected and PRs fail when
deprecated codes are reintroduced.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 029a6dc — removed HRK (Croatian Kuna, replaced by EUR in 2023) and SLL (Sierra Leonean Leone, replaced by SLE). Dataset now has 148 currencies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped: comment is from another GitHub bot.

Comment thread rust/Cargo.toml
Comment on lines +39 to +48
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio", "macros", "migrate"] }
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json"] }

# WASM-only: IndexedDB + wasm async executor
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
indexed_db_futures = "0.4"
reqwest = { version = "0.12", default-features = false, features = ["json"] }

@coderabbitai coderabbitai Bot Mar 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Target-specific dependency sections =="
sed -n '38,48p' rust/Cargo.toml

echo
echo "== Existing wasm CI coverage =="
rg -n --hidden -S 'wasm32-unknown-unknown|cargo (check|build).*wasm32|rustup target add wasm32-unknown-unknown' . || true

Repository: MostroP2P/app

Length of output: 1286


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Searching for CI workflow files =="
find . -type f \( -name "*.yml" -o -name "*.yaml" \) -path "*/.github/workflows/*" -o -name ".gitlab-ci.yml" -o -name "*.circleci*" 2>/dev/null | head -20

echo
echo "== Checking git ls-files for CI config patterns =="
git ls-files | grep -E '(\.github/workflows|\.gitlab-ci|circleci|\.travis)' || echo "No CI files found via git ls-files"

echo
echo "== Searching all workflow files for wasm references =="
find . -type f \( -name "*.yml" -o -name "*.yaml" \) 2>/dev/null | xargs grep -l "wasm32\|wasm-pack\|flutter_rust_bridge" 2>/dev/null || echo "No wasm references in workflow files"

Repository: MostroP2P/app

Length of output: 408


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== flutter_rust_bridge.yaml content =="
cat flutter_rust_bridge.yaml 2>/dev/null || echo "File not found"

echo
echo "== Checking rust_builder/cargokit for wasm build references =="
find rust_builder/cargokit -type f -name "*.yaml" -o -name "*.yml" -o -name "*.sh" 2>/dev/null | xargs grep -l "wasm\|target" 2>/dev/null | head -5

echo
echo "== Check if pubspec.yaml mentions wasm build =="
grep -A5 -B5 "wasm\|rust.*target" pubspec.yaml 2>/dev/null || echo "No wasm refs in pubspec.yaml"

Repository: MostroP2P/app

Length of output: 532


Add explicit wasm target validation to your build process.

The wasm-specific dependencies on lines 45–48 are never exercised by a normal native cargo build. Without validation, a broken wasm resolver graph can merge unnoticed. Add a cargo check --target wasm32-unknown-unknown step to catch cross-target issues early, especially once rust/src/db begins depending on these crates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rust/Cargo.toml` around lines 39 - 48, Add an explicit wasm target validation
step to the build/CI: run `cargo check --target wasm32-unknown-unknown` after
the native build to ensure the wasm-specific dependency graph (the
`[target.'cfg(target_arch = "wasm32")'.dependencies]` entries including
`wasm-bindgen-futures`, `indexed_db_futures`, and the wasm `reqwest` feature
set) is exercised and errors surface early; update the project's CI/build script
to invoke this command (or equivalent cargo invocation) so wasm-only resolver
issues are caught before merging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 029a6dc — added cargo check --target wasm32-unknown-unknown to the pre-commit hook so wasm-specific dependency issues are caught before merging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped: comment is from another GitHub bot.

mostronatorcoder Bot and others added 2 commits March 29, 2026 20:38
- pre-commit: add cargo test before clippy + wasm32 target check
- fiat.json: remove obsolete ISO codes HRK and SLL
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.

1 participant