Commit Graph

64 Commits

Author SHA1 Message Date
ghost43 7da3613b12 Merge pull request #8906 from accumulator/old_2fa_passphrase
wizard: skip/hide passphrase option for 'old' and '2fa' seeds (see #4326)
2024-02-21 17:03:43 +00:00
Sander van Grieken 8ce1e6453b wizard: skip/hide passphrase option for 'old' and '2fa' seeds (see #4326) 2024-02-21 17:15:10 +01:00
SomberNight 8ab3dcce5d keystore: API changes for from_seed/from_bip43_rootseed/bip39_to_seed
- force kwargs
- add type hints
2024-02-21 15:08:19 +00:00
SomberNight fffbc178cd qt wizard: hww dialogs: log some exceptions more aggressively
sort of related: https://github.com/spesmilo/electrum/issues/8892
2024-02-14 09:05:21 +00:00
Sander van Grieken 0a2a22b822 qt: use selected_key instead of selected_item[0] for ChoiceWidgets 2024-02-05 14:39:03 +01:00
SomberNight e7ebf5d950 qt wizard: handle some cases of hw device being unplugged during flow
To reproduce, open two wizards in parallel. Use one to enter the flow and start creating a wallet,
then physically unplug the hw device at the correct time, and use the other wizard to trigger a rescan.
The rescan will unpair the hw device, resulting in device_manager.client_by_id to return None when
continuing the flow on the first wizard.

fixes https://github.com/spesmilo/electrum/issues/8858
2024-01-31 04:02:02 +00:00
Sander van Grieken 4a4497b5e9 qt: wizard: styling, add icons to success/error messages 2024-01-16 12:44:00 +01:00
Sander van Grieken 82c21bc30d wizard: take hardware_device from correct location for cosigners. fixes #8808 2024-01-16 11:45:20 +01:00
Sander van Grieken d19dd817d3 followup dab768b932 2024-01-16 10:27:40 +01:00
SomberNight 77c55d78b7 qt wizard: show warning when trying to restore 2fa seed as std wallet
With wallet_type=="standard", if the user enters a 2fa electrum seed, the "next" btn is disabled.
This is a regression in the new wizard, the old one used to "redirect" seamlessly.
This commit does not fix this, but at least shows a user-friendly warning message.

Note: would be nice if the wizard redirected automatically, in both directions (2fa->std, std->2fa).
The old wizard implemented std->2fa (probably the more common case hit by users), and had this
warning message shown for the 2fa->std case. Now I am repurposing the warning also for std->2fa.
2024-01-05 15:00:45 +00:00
SomberNight dab768b932 qt/wizard/wallet: improve typing: introduce WalletWizardComponent cls 2024-01-05 13:34:57 +00:00
SomberNight 201c0ab71b qt wizard: fix restoring from 2fa seed
follow-up 7df057aaf9
2024-01-05 12:51:54 +00:00
Sander van Grieken a03b2d7bae qt,qml: add a welcome page as initial page for server connect wizard
This is much less intimidating than asking if the user wants to use a proxy
out of the gate.
2023-12-19 18:49:16 +01:00
SomberNight da775954c0 qt wizard: fix wallets directory relative paths on Windows
follow-up https://github.com/spesmilo/electrum/pull/8651

We cannot do direct comparison of path-like strings without normalisation.
E.g.
```
relative_path() cp1. path='c:\\users\\user\\appdata\\roaming\\electrum\\wallets\\9dk', wallets=C:\Users\User\AppData\Roaming\Electrum\wallets
relative_path() cp2. commonpath='c:\\users\\user\\appdata\\roaming\\electrum\\wallets'
relative_path() cp3. new_path='9dk'
```
2023-12-12 01:34:46 +00:00
Sander van Grieken 24323d21a2 qt: add note in wizard if wallet path is outside the default wallets folder 2023-12-01 16:14:32 +01:00
Sander van Grieken b59e9089a0 qt: use datadir wallets folder consistently 2023-12-01 16:14:32 +01:00
Sander van Grieken 5c96847111 qt: show wallet as relative path if below datadir wallets folder 2023-12-01 16:14:32 +01:00
Sander van Grieken f708e7f03e wizard/wallet: clean up imports, code style warnings. 2023-11-07 11:05:30 +01:00
Sander van Grieken 4671c002c9 qt: fix detected account select (#8673) 2023-11-02 12:49:31 +01:00
SomberNight 3060372894 qt wizard: WCHaveMasterKey: use check_multisig_constraints
These checks were missing from validation. e.g. duplicate master keys were allowed.
2023-10-31 17:43:15 +01:00
SomberNight 4b2d8f062c qt wizard: fix WCHaveMasterKey for first multisig cosigner
fixes https://github.com/spesmilo/electrum/issues/8665
2023-10-31 17:43:15 +01:00
SomberNight 7df057aaf9 qt wizard: simplify WCHaveSeed 2023-10-31 17:43:15 +01:00
Sander van Grieken 7ca9b735d5 daemon: refactor load_wallet to not just return None, but raise specific exceptions.
The following exceptions should be expected:
FileNotFoundError: given wallet path does not exist
StorageReadWriteError: given file is not readable/writable or containing folder is not writable
InvalidPassword: wallet requires a password but no password or an invalid password was given
WalletFileException: any internal wallet data issue. specific subclasses can be caught separately:
-  WalletRequiresSplit: wallet needs splitting (split_data passed in Exception)
-  WalletRequiresUpgrade: wallet needs upgrade, and no upgrade=True was passed to load_wallet
-  WalletUnfinished: wallet file contains an action and needs additional information to finalize. (WalletDB passed in exception)

Removed qml/qewalletdb.py

This patch also fixes load_wallet calls in electrum/scripts and adds a qml workaround for dialogs opening and closing so
fast that the dialog opened==true property change is missed (which we need to manage the dialog/page stack)
2023-10-10 17:42:07 +02:00
ThomasV b5bc5ff9ed Separate WalletDB from storage upgrades.
Make sure that WalletDB.data is always a StoredDict.
Perform db upgrades in a separate class, since they
operate on a dict object.
2023-09-22 15:02:06 +02:00
Sander van Grieken 44a1595157 wizard: don't use hww encryption of wallet files for anything besides standard wallets,
check hw wallet file decrypt in WCHWUnlock,
fix assumption 'wallet_type' exists in wallet open scenario.
2023-09-21 14:20:01 +02:00
Sander van Grieken 2caa8f13cf wizard: make wizard.keystore_from_data more robust;
- always store 'keystore_type' in cosigner data and use same types as main
- dont share 'hardware_device' in root of dict, but store for each cosigner
- properly return hardware keystore for hardware cosigners
2023-09-20 14:34:31 +02:00
Sander van Grieken 5080c224d0 qt: fix device list after rescan 2023-09-20 14:34:31 +02:00
SomberNight d2c7df3180 wizard: fix hww scan debug_msg not working correctly 2023-09-20 14:34:31 +02:00
Sander van Grieken 4101946ff5 wizard: add non-hardened derivation path check for digital bitbox, re-add rescan button in choose hw device,
clear clipboard before confirming seed.
2023-09-20 14:34:31 +02:00
Sander van Grieken 60d1d1e599 wizard: add missing keepkey porting, fix password focus for default and picked wallets,
add abstract method decl HW_PluginBase.wizard_entry_for_device
2023-09-20 14:34:31 +02:00
Sander van Grieken 7fd3b6c91d wizard: remove finished call, it's unused
qt: call is_finalized before closing the wizard dialog and add a check if wallet can be
    decrypted with the supplied secret (user pw, hw device)
2023-09-20 14:34:31 +02:00
Sander van Grieken dd64b5c628 wizard: add bitbox02 new wallet init and checks to new wizard 2023-09-20 14:34:31 +02:00
Sander van Grieken 50d2cdb1b5 wizard: improve hww uninitialized default msg. attempt fix flake issue w.r.t ABC 2023-09-20 14:34:31 +02:00
Sander van Grieken b7612605c5 wizard: add Digital Bitbox initialization to new wizard, remove rescan button
Note: the option to load a backup from SD card when the device already has a seed
has been removed. The device always returns an error when attempting this.
2023-09-20 14:34:31 +02:00
Sander van Grieken f3d843a855 qt: hww scan, focus rescan button only if no devices found 2023-09-20 14:34:31 +02:00
Sander van Grieken d4d57c3aef qt: automatically proceed wizard when unlocking existing wallet or succesful retrieve of xpub
for new wallet
2023-09-20 14:34:31 +02:00
Sander van Grieken d68e6a69c1 qt: wizardcomponents all use Logger mixin. Fix missing self.plugins init in WCTrezorInitMethod 2023-09-20 14:34:31 +02:00
Sander van Grieken bb8b82cc7e qt: wizard back button disabled while busy. Wrap error texts 2023-09-20 14:34:31 +02:00
Sander van Grieken 53b12cb086 qt: check HWW supported script types 2023-09-20 14:34:31 +02:00
Sander van Grieken faf35366b8 qt: single_password doesn't seem to be supported on desktop, disable also on new wizard 2023-09-20 14:34:31 +02:00
Sander van Grieken 97c9fd20b2 flake 2023-09-20 14:34:31 +02:00
Sander van Grieken 7080a7d8e2 qt: new wizard 2fa wallet online continuation from offline initial setup 2023-09-20 14:34:31 +02:00
Sander van Grieken 5ff945e9d6 qt: wizard run_upgrades 2023-09-20 14:34:31 +02:00
Sander van Grieken 66e9f502b0 qt: generalize wizard HWW xpub 2023-09-20 14:34:31 +02:00
Sander van Grieken 8663d89f77 qt: add HWW unlock wizardcomponent 2023-09-20 14:34:31 +02:00
Sander van Grieken 83c2eb46bb qt: initial open existing wallet from wizard,
set window title for wizard dialogs,
catch RuntimeError for WizardComponent.updated signal, widget might be gone
2023-09-20 14:34:31 +02:00
Sander van Grieken 902290ee8c qt: multisig checks with hardware cosigners 2023-09-20 14:34:31 +02:00
Sander van Grieken d3a1cef9ba create ChoiceWidget, refactor ChoicesLayout to ChoiceWidget 2023-09-20 14:34:31 +02:00
Sander van Grieken b7ed4c569b wip. trezor works for standard wallet, also for cosigners 2023-09-20 14:34:31 +02:00
Sander van Grieken 0de6216560 qt: have_seed and create_seed support 2fa 2023-09-20 14:34:30 +02:00