Block imported Monero wallets from using the Edge LWS backend#6053
Merged
Conversation
2d07ca9 to
b9685ff
Compare
Contributor
Author
j0ntz
approved these changes
Jun 29, 2026
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>
ff06c68 to
48d6026
Compare
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.

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
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: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 inSpecialCurrencyInfo.checkImportedWalletSettingsso 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
monerodand 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, sharedasMoneroUserSettings). StaticdefaultImportedWalletSettings: { backend: 'monerod' }is removed in favor of the dynamic override. Unit tests coverisMoneroEdgeLwsand allcheckImportedWalletSettingsbranches.Reviewed by Cursor Bugbot for commit 48d6026. Bugbot is set up for automated code reviews on this repo. Configure here.