|
@ -34,7 +34,7 @@ from .keystore import bip44_derivation, purpose48_derivation |
|
|
from .wallet import Imported_Wallet, Standard_Wallet, Multisig_Wallet, wallet_types, Wallet |
|
|
from .wallet import Imported_Wallet, Standard_Wallet, Multisig_Wallet, wallet_types, Wallet |
|
|
from .storage import STO_EV_USER_PW, STO_EV_XPUB_PW, get_derivation_used_for_hw_device_encryption |
|
|
from .storage import STO_EV_USER_PW, STO_EV_XPUB_PW, get_derivation_used_for_hw_device_encryption |
|
|
from .i18n import _ |
|
|
from .i18n import _ |
|
|
from .util import UserCancelled, InvalidPassword |
|
|
from .util import UserCancelled, InvalidPassword, WalletFileException |
|
|
|
|
|
|
|
|
# hardware device setup purpose |
|
|
# hardware device setup purpose |
|
|
HWD_SETUP_NEW_WALLET, HWD_SETUP_DECRYPT_WALLET = range(0, 2) |
|
|
HWD_SETUP_NEW_WALLET, HWD_SETUP_DECRYPT_WALLET = range(0, 2) |
|
@ -106,10 +106,20 @@ class BaseWizard(object): |
|
|
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type) |
|
|
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type) |
|
|
|
|
|
|
|
|
def upgrade_storage(self): |
|
|
def upgrade_storage(self): |
|
|
|
|
|
exc = None |
|
|
def on_finished(): |
|
|
def on_finished(): |
|
|
self.wallet = Wallet(self.storage) |
|
|
if exc is None: |
|
|
self.terminate() |
|
|
self.wallet = Wallet(self.storage) |
|
|
self.waiting_dialog(partial(self.storage.upgrade), _('Upgrading wallet format...'), on_finished=on_finished) |
|
|
self.terminate() |
|
|
|
|
|
else: |
|
|
|
|
|
raise exc |
|
|
|
|
|
def do_upgrade(): |
|
|
|
|
|
nonlocal exc |
|
|
|
|
|
try: |
|
|
|
|
|
self.storage.upgrade() |
|
|
|
|
|
except Exception as e: |
|
|
|
|
|
exc = e |
|
|
|
|
|
self.waiting_dialog(do_upgrade, _('Upgrading wallet format...'), on_finished=on_finished) |
|
|
|
|
|
|
|
|
def load_2fa(self): |
|
|
def load_2fa(self): |
|
|
self.storage.put('wallet_type', '2fa') |
|
|
self.storage.put('wallet_type', '2fa') |
|
|