Browse Source

fix: load trustedcoin plugin for two-step wallet creation

sqlite_db
ThomasV 6 years ago
parent
commit
3631c27ed7
  1. 1
      electrum/base_wizard.py
  2. 2
      electrum/gui/qt/installwizard.py
  3. 9
      electrum/storage.py
  4. 5
      electrum/wallet.py

1
electrum/base_wizard.py

@ -566,6 +566,7 @@ class BaseWizard(object):
for key, value in self.data.items():
storage.put(key, value)
storage.write()
storage.load_plugins()
return storage
def show_xpub_and_add_cosigners(self, xpub):

2
electrum/gui/qt/installwizard.py

@ -317,7 +317,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
self.show_warning(_('The file was removed'))
return
self.show()
self.data = storage.data
self.data = storage.db.data # FIXME
self.run(action)
for k, v in self.data.items():
storage.put(k, v)

9
electrum/storage.py

@ -31,7 +31,7 @@ import zlib
from . import ecc
from .util import PrintError, profiler, InvalidPassword, WalletFileException, bfh, standardize_path
from .plugin import run_hook
from .plugin import run_hook, plugin_loaders
from .json_db import JsonDB
@ -68,6 +68,13 @@ class WalletStorage(PrintError):
# avoid new wallets getting 'upgraded'
self.db = DB_Class('', manual_upgrades=False)
self.load_plugins()
def load_plugins(self):
wallet_type = self.db.get('wallet_type')
if wallet_type in plugin_loaders:
plugin_loaders[wallet_type]()
def put(self, key,value):
self.db.put(key, value)

5
electrum/wallet.py

@ -54,7 +54,7 @@ from .util import multisig_type
from .storage import STO_EV_PLAINTEXT, STO_EV_USER_PW, STO_EV_XPUB_PW, WalletStorage
from . import transaction, bitcoin, coinchooser, paymentrequest, ecc, bip32
from .transaction import Transaction, TxOutput, TxOutputHwInfo
from .plugin import run_hook, plugin_loaders
from .plugin import run_hook
from .address_synchronizer import (AddressSynchronizer, TX_HEIGHT_LOCAL,
TX_HEIGHT_UNCONF_PARENT, TX_HEIGHT_UNCONFIRMED)
from .paymentrequest import (PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED,
@ -1829,9 +1829,6 @@ class Wallet(object):
def __new__(self, storage):
wallet_type = storage.get('wallet_type')
# check here if I need to load a plugin
if wallet_type in plugin_loaders:
plugin_loaders[wallet_type]()
WalletClass = Wallet.wallet_class(wallet_type)
wallet = WalletClass(storage)
# Convert hardware wallets restored with older versions of

Loading…
Cancel
Save