1
0

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
This commit is contained in:
SomberNight
2020-03-31 15:56:54 +02:00
parent 570f7b7790
commit 18d245ad5c
2 changed files with 6 additions and 5 deletions

View File

@@ -26,7 +26,7 @@
from typing import TYPE_CHECKING, Dict, List, Union, Tuple, Sequence, Optional, Type
from electrum.plugin import BasePlugin, hook, Device, DeviceMgr
from electrum.plugin import BasePlugin, hook, Device, DeviceMgr, DeviceInfo
from electrum.i18n import _
from electrum.bitcoin import is_address, opcodes
from electrum.util import bfh, versiontuple, UserFacingException
@@ -64,7 +64,7 @@ class HW_PluginBase(BasePlugin):
if isinstance(keystore, self.keystore_class):
self.device_manager().unpair_xpub(keystore.xpub)
def setup_device(self, device_info, wizard: 'BaseWizard', purpose):
def setup_device(self, device_info: DeviceInfo, wizard: 'BaseWizard', purpose):
"""Called when creating a new wallet or when using the device to decrypt
an existing wallet. Select the device to use. If the device is
uninitialized, go through the initialization process.