commit cb9dcb8e2674b39285917e864769322f705a1836
parent d73f7a2c1080ff564a123b67340dae02f31d2f1f
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 26 Feb 2019 09:44:34 +0100
load wallet plugin in Wallet factory, fix trustedcoin wizard on kivy
Diffstat:
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/electrum/json_db.py b/electrum/json_db.py
@@ -31,7 +31,6 @@ from typing import Dict
from . import util, bitcoin
from .util import PrintError, profiler, WalletFileException, multisig_type, TxMinedInfo
-from .plugin import plugin_loaders
from .keystore import bip44_derivation
from .transaction import Transaction
@@ -105,11 +104,6 @@ class JsonDB(PrintError):
if not isinstance(self.data, dict):
raise WalletFileException("Malformed wallet file (not dict)")
- # check here if I need to load a plugin
- t = self.get('wallet_type')
- l = plugin_loaders.get(t)
- if l: l()
-
if not self.manual_upgrades:
if self.requires_split():
raise WalletFileException("This wallet has multiple accounts and must be split")
diff --git a/electrum/plugins/trustedcoin/trustedcoin.py b/electrum/plugins/trustedcoin/trustedcoin.py
@@ -629,6 +629,7 @@ class TrustedCoinPlugin(BasePlugin):
k3 = keystore.from_xpub(xpub3)
wizard.data['x3/'] = k3.dump()
wizard.pw_args = password, encrypt_storage, STO_EV_USER_PW
+ wizard.terminate()
def create_remote_key(self, email, wizard):
xpub1 = wizard.data['x1/']['xpub']
diff --git a/electrum/wallet.py b/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
+from .plugin import run_hook, plugin_loaders
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,
@@ -1838,6 +1838,9 @@ 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