Skip to content

Block imported Monero wallets from using the Edge LWS backend#6053

Merged
peachbits merged 2 commits into
developfrom
matthew/monero-imported-wallet-backend
Jun 30, 2026
Merged

Block imported Monero wallets from using the Edge LWS backend#6053
peachbits merged 2 commits into
developfrom
matthew/monero-imported-wallet-backend

Conversation

@peachbits

@peachbits peachbits commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Asana: https://app.asana.com/0/1213880789473005/1215859683644063

Imported Monero wallets were silently created on the Edge LWS backend even though imported wallets are not permitted to use Edge's own LWS server (each watched wallet has an ongoing server-side scanning cost). The edit-name scene seeded the backend wallet setting from its first option (lws), which then flowed through to wallet creation.

This centralizes the rule as SpecialCurrencyInfo.checkImportedWalletSettings(settings, userSettings) so the import flow and the Wallet Settings modal stay in sync:

  • Tapping Import Wallets on the edit-name scene now validates the chosen backend. When an override is required, a Choose A Different Server modal explains that Edge LWS isn't supported for imported wallets and offers two choices: Use Full Node applies the full-node override and proceeds to the import scene, while More Settings navigates to the asset's currency settings so a custom LWS server can be configured. Dismissing the modal cancels without entering the import scene.
  • The Wallet Settings modal rejects the same combination via the shared helper (replacing an inline duplicate of the rule).
  • A custom (non-Edge) LWS server is still allowed.

Added unit tests (src/__tests__/moneroImportSettings.test.ts) covering every branch of the rule; existing snapshot/scene tests pass.

Device-testing note: the affected logic is covered by unit + snapshot tests. Live on-device verification of this iteration was blocked by an unrelated environment issue (the app would not get past the splash screen against Edge's servers); an earlier, behavior-equivalent version of the override was verified on the iOS simulator (imported wallet → Full Node).


Note

Medium Risk
Changes which Monero backend imported wallets use (sync path and server-side scanning cost), but the rule is centralized and covered by new unit tests with limited blast radius beyond Monero import/settings.

Overview
Imported Monero wallets could still be created on Edge LWS because the edit-name flow defaulted the backend to lws. This PR centralizes the rule in SpecialCurrencyInfo.checkImportedWalletSettings so import and wallet settings stay aligned.

Import flow: Before entering the import scene, the app checks imported wallet backends. If Edge LWS would be used, a Choose A Different Server modal offers Use Full Node (applies monerod and continues) or More Settings (opens currency settings for a custom LWS). Dismissing cancels import.

Wallet settings: The modal’s inline Monero check is replaced with the same helper, surfacing the existing error when a user tries to select LWS on an imported wallet under Edge LWS.

Monero detection moves to src/util/monero.ts (isMoneroEdgeLws, shared asMoneroUserSettings). Static defaultImportedWalletSettings: { backend: 'monerod' } is removed in favor of the dynamic override. Unit tests cover isMoneroEdgeLws and all checkImportedWalletSettings branches.

Reviewed by Cursor Bugbot for commit 48d6026. Bugbot is set up for automated code reviews on this repo. Configure here.

@peachbits peachbits force-pushed the matthew/monero-imported-wallet-backend branch from 2d07ca9 to b9685ff Compare June 25, 2026 22:23
@peachbits

Copy link
Copy Markdown
Contributor Author
image

peachbits and others added 2 commits June 30, 2026 10:06
Imported Monero wallets were created on the Edge LWS backend despite the
business rule that imported wallets must use a full node (or a user-configured
custom LWS) -- each watched wallet has an ongoing server-side scanning cost.
The GUI seeded the backend wallet setting from the first option ('lws') on the
edit-name scene, which then rode through to wallet creation.

Centralize the rule as SpecialCurrencyInfo.checkImportedWalletSettings so the
import flow and the Wallet Settings modal stay in sync:
- tapping "Import Wallets" on the edit-name scene validates the chosen backend;
  when an override is required it shows a modal offering to continue with a full
  node or to open the asset's currency settings to configure a custom LWS server
- the Wallet Settings modal rejects the same combination via the shared helper
- a custom (non-Edge) LWS server is still allowed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
checkImportedWalletSettings must still force an imported lws wallet onto
the full node when the account has never configured Monero servers (its
userSettings is the empty object edge-core-js initializes). Documents that
the 'Expected a boolean, got undefined at .enableCustomServers' crash from
older builds is resolved by routing every asMoneroUserSettings consumer
through asMaybe.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@peachbits peachbits force-pushed the matthew/monero-imported-wallet-backend branch from ff06c68 to 48d6026 Compare June 30, 2026 17:07
@peachbits peachbits merged commit 6cd8d59 into develop Jun 30, 2026
7 checks passed
@peachbits peachbits deleted the matthew/monero-imported-wallet-backend branch June 30, 2026 20:29
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