Commit graph

68 commits

Author SHA1 Message Date
ThomasV
5313438140 fix display of Zpub in Kivy during multisig wallet creation (see #6456) 2020-08-26 20:26:59 +02:00
SomberNight
df82d9c017
bip39 scan: follow-up prev
- use logger
- allow qt dialog to be GC-ed
- (trivial) add typing; minor formatting
2020-08-20 18:58:52 +02:00
Luke Childs
7b122d2679
Automated BIP39 Recovery, squashed 2020-08-20 17:50:39 +02:00
relativistic electron
fbc539e2cc One can now click the back button in the show_xpub_and_add_cosigners wizard step 2020-05-07 10:19:48 +02:00
SomberNight
08118ca167
qt wizard: tweak GoBack behaviour to recalc inputs to previous dialog
follow-up f13f46c555

When on dialog n user presses "Back",
- previously, we went back to when dialog n-1 appeared
- now, go back to just after dialog n-2 finishes
This way, any calculations between when dialog n-2 finishes and
dialog n-1 appears will rerun, potentially populating dialog n-1 differently.

Namely if the user presses back on the confirm_seed_dialog, we want to
go back to the show_seed_dialog but with a freshly generated seed.
2020-04-11 15:50:12 +02:00
SomberNight
b6bac0182f
wizard hww: use exception handling to choose hw device again
- no need to pass args, caller knows what it wanted
- avoids deepening the call stack on every rescan
  (nicer tracebacks, no stack overflow)
2020-04-09 19:45:45 +02:00
SomberNight
71eed1d4cb
wizard: (trivial) add show_error to base class, document API 2020-04-09 19:45:42 +02:00
SomberNight
08a7925235
wizard.create_storage: state API and abide by it
none of the callers was handling the return None case properly...
2020-04-09 19:45:38 +02:00
SomberNight
a3e1b2e00c
wizard: hww creation flow: don't just swallow exception
if we just return here, the calling code will try to create the storage and fail
2020-04-09 19:45:35 +02:00
SomberNight
4b1d835304
wizard hww: scan devices fewer times and move away from GUI thread 2020-04-09 19:45:31 +02:00
SomberNight
7c830cb221
wizard hww: move devmgr.scan_devices() away from GUI thread 2020-04-08 18:54:11 +02:00
SomberNight
db1ff4915f
hww: show model name in device enum lists (e.g. "Trezor T") 2020-04-08 17:53:40 +02:00
SomberNight
9d0bb295e6
hww: distinguish devices based on "soft device id" (not just labels)
fixes #5759
2020-04-08 14:44:42 +02:00
SomberNight
f13f46c555
qt wizard: make "GoBack" unroll the call stack to avoid stack overflow
fixes #6069
2020-04-03 18:58:51 +02:00
SomberNight
371f55a0f9
hww: fix some threading issues in wizard
fixes #3377
related: #6064  (passphrase dialog not rendered correctly)
2020-04-01 21:09:17 +02:00
SomberNight
18c98483ac
wizard: (trivial) add some type hints 2020-04-01 21:09:10 +02:00
SomberNight
c0b170acb7
hww wizard: better handle UserFacingException in one case
E | gui.qt.installwizard.InstallWizard |
Traceback (most recent call last):
  File "...\electrum\electrum\base_wizard.py", line 340, in on_device
    self.plugin.setup_device(device_info, self, purpose)
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 719, in setup_device
    client.get_xpub("m/44'/0'", 'standard')
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 120, in get_xpub
    reply = self._get_xpub(bip32_path)
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 114, in _get_xpub
    if self.check_device_dialog():
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 223, in check_device_dialog
    self.recover_or_erase_dialog() # Already seeded
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 244, in recover_or_erase_dialog
    if not self.dbb_load_backup():
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 340, in dbb_load_backup
    raise UserFacingException(backups['error']['message'])
electrum.util.UserFacingException: Please insert SD card.
2020-04-01 21:08:56 +02:00
SomberNight
18d245ad5c
hw wallets: during wallet creation, make sure to save correct label
When initialising a Trezor as part of the wallet creation,
device_info.label is still the old (None) label in on_hw_derivation.
This is because device_info was created during the initial scan.

related: #6063
2020-03-31 15:56:54 +02:00
SomberNight
6760c3f252
hw wallets: introduce HardwareHandlerBase
previously, client.handler was sometimes
- an InstallWizard
- a QtHandlerBase where win was an ElectrumWindow
- a QtHandlerBase where win was an InstallWizard
- a CmdLineHandler

That's just too much dynamic untyped undocumented polymorphism...
Now it will never be an InstallWizard (replaced with QtHandlerBase where win is an InstallWizard),
and now in all cases client.handler is an instance of HardwareHandlerBase, yay.

related: #6063
2020-03-31 14:40:25 +02:00
SomberNight
f8ba660583
clean-up hw-wallet "get_password_for_storage_encryption"-related code 2020-02-28 19:47:56 +01:00
ThomasV
e1ce3aace7 Separate db from storage
- storage is content-agnostic
 - db and storage are passed to wallet contructor
2020-02-10 17:45:23 +01:00
SomberNight
9b28f6df7b
wallet: encrypt storage by default
notably, now also in kivy
2019-12-19 14:22:47 +01:00
SomberNight
f73b6b5d23
keystore: cache derive_pubkey 2019-12-09 03:35:20 +01:00
SomberNight
d3fd87ebd0
hardware wallets: wizard no longer requests xpub at path "m"
This was done to calculate the bip32 root fingerprint but it broke
the digitalbitbox. The keystore already had a different way to get
the root fingerprint for existing wallets, specifically handling this
case; the code in base_wizard used when creating new wallets was
duplicating that code originally and was then forgotten to be updated.
Now these codepaths are unified.

closes #5816
2019-12-02 19:31:17 +01:00
SomberNight
88307357ec
add some type hints
mostly related to hw wallets
2019-11-22 22:59:33 +01:00
SomberNight
e6c841d05f
psbt: put fake xpubs into globals. keystores handle xfp/der_prefix missing 2019-11-04 22:24:59 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
99b83f7527
fix #5617 2019-09-04 13:53:38 +02:00
SomberNight
a42a773d19
storage: replace STO_EV_* ints with IntEnum 2019-09-04 13:31:49 +02:00
SomberNight
bffc2a1d4b
wizard: try harder to have temporarily stored pw erased from memory 2019-08-14 17:27:38 +02:00
ThomasV
aa7aeb9014 disable go_back button in wizard password dialog (fix #5509) 2019-08-14 10:14:28 +02:00
ThomasV
a7b61fcab9 kivy: support bip39 seeds 2019-08-13 17:14:54 +02:00
SomberNight
fb76fcc886
trezor: use only Bridge when available
fixes #5420
2019-07-02 21:21:39 +02:00
SomberNight
371e1a6ebf
hw: allow bypassing "too old firmware" error when using hw wallets
The framework here is generic enough that it can be used for any hw plugin,
however atm only Trezor is implemented.

closes #5391
2019-05-31 04:09:03 +02:00
SomberNight
37da192bf5
wizard/hw: less spammy logs when hw library unavailable
closes #5380
2019-05-26 17:01:01 +02:00
SomberNight
003e6c3e79
fix 2fa wallet creation via qt gui
closes #5334
2019-05-14 15:32:57 +02:00
SomberNight
3385a94753
logging: basics 2019-05-02 15:19:03 +02:00
SomberNight
a1d98d4331
sweep/import key: show error in Qt GUI to user as tooltip 2019-04-19 00:15:45 +02:00
SomberNight
12b98fa251
wizard: fix regression: unencrypted wallets were not getting upgraded
fixes #5177
2019-03-04 17:23:43 +01:00
SomberNight
2da6692f73
wizard: some fixes
related: #5174
2019-03-04 02:08:23 +01:00
SomberNight
b076f5294f
wizard: allow kwargs in run() 2019-03-03 17:32:00 +01:00
SomberNight
d0fa3b431a
wallet: generate addresses in Deterministic_Wallet constructor 2019-02-28 21:22:10 +01:00
ThomasV
3631c27ed7 fix: load trustedcoin plugin for two-step wallet creation 2019-02-28 13:11:00 +01:00
SomberNight
4b36114d0d small fixups 2019-02-28 09:02:58 +01:00
ThomasV
d5790ea109 wizard: do not use on storage object during wallet creation 2019-02-28 09:02:58 +01:00
SomberNight
11733d6bc2
wizard: normalize bip32 derivation path
so that what gets put in storage is "canonical"
(from now on... we could storage upgrade existing wallets
but it's not critical)
2019-02-22 18:50:29 +01:00
SomberNight
b39c51adf7
mv "electrum seed" stuff from bitcoin.py to mnemonic.py 2019-02-22 18:01:54 +01:00
SomberNight
8412b53ed5
wizard: copy/restore storage when stepping through the wizard
When interacting with wizard, there is a single shared storage instance.
If you go down the tree of dialogs, press "back" a couple times, go
down another branch of dialogs, etc, there are side-effects on storage,
which are never undone.

fixes #5057
fixes #4496
2019-02-04 20:27:01 +01:00
SomberNight
9013f6d59e
wizard: make 'stack' private 2019-02-04 20:27:00 +01:00
SomberNight
f2ad116b0b
wizard: better hww debug messages when unpaired_device_infos fails
[DeviceMgr] scanning devices...
[DeviceMgr] failed to create client for ledger at b'0002:0007:00': OSError('open failed',)
[DeviceMgr] error getting device infos for ledger: open failed

^ GUI did not contain any info about failure
2019-01-21 18:44:36 +01:00