Skip to content

Switch to FactWallet-specific data directories and add UI for semi-auto migration#24

Merged
ReverseControl merged 3 commits intoProjectFactor:masterfrom
NyanCatTW1:master
Apr 28, 2025
Merged

Switch to FactWallet-specific data directories and add UI for semi-auto migration#24
ReverseControl merged 3 commits intoProjectFactor:masterfrom
NyanCatTW1:master

Conversation

@NyanCatTW1
Copy link
Copy Markdown
Member

@NyanCatTW1 NyanCatTW1 commented Apr 26, 2025

Changes

1: Change default data directory paths to use FactWallet-specific locations

  • Linux: ~/.factwallet (was ~/.electrum)
  • Windows: %APPDATA%\FactWallet (was %APPDATA%\Electrum)
  • Portable mode: factwallet_data (was electrum_data)

2: Migration UI

  • Add migration utility (electrum/migration.py) that:
    • Runs after the wallet is started and before the main GUI is launched
    • Skips migration when
      • A wallet already exists in the new default location (eg. ~/.factwallet)
      • The data directory is customized by the user via -D/--dir
      • Running on Android (since FactWallet's app data won't conflict with another app's)
    • Detects if an existing Electrum directory contains FACT0RN wallet data (by checking whether blockchain_preferred_block in config is a mainnet/testnet FACT0RN genesis block)
    • Shows migration dialog with two options
      • Yes: Proceed with the migration
      • No: Ignore the existing directory and create a new wallet
    • Moves the original Electrum directory to a timestamped backup directory (eg. Electrum-backupByFactWallet-20250426205619)
    • Copies wallet data to the new FactWallet location
    • Creates a migration marker file for audit purposes (eg. ~/.factwallet/.migrated_from_electrum)

3: Housekeeping

  • Bumped version to 4.6
  • Updated APK version to 4.6.0.0
  • Updated WineHQ GPG key checksum to June 2024 version

Testing Performed

Tested functionalities

  • No migration is performed when ~/.electrum doesn't exist, or when ~/.factwallet already exists
  • No migration is performed when ~/.electrum exists but is created by Electrum (the BTC wallet)
  • Migration is performed when ~/.factwallet doesn't exist, and ~/.electrum exists + contains FACT0RN wallet data
  • When migration fails, the backup folder is unchanged, and FactWallet exits immediately after explaining the error and where the backup is, allowing the user to manually recover the wallet

The above testing was performed on:

  • Linux AppImage (with and without --portable)
  • Windows normal build
  • Windows portable build

Lastly, for the record, this is how I built the test binaries with Cirrus CLI locally:

  • AppImage:
    docker build -t factwallet-ci-appimage . (in contrib/build-linux/appimage)
    ~/Tools/cirrus-linux-amd64 run --dirty --lazy-pull --dockerfile-image-template=factwallet-ci-appimage "build: AppImage"
  • Windows:
    docker build -t factwallet-ci-windows . (in contrib/build-wine)
    ~/Tools/cirrus-linux-amd64 run --dirty --lazy-pull --dockerfile-image-template=factwallet-ci-windows "build: Windows"

@ReverseControl ReverseControl merged commit 999540b into ProjectFactor:master Apr 28, 2025
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