1
0

request account_id in wizard, for hardware wallets. cleanup bip44 code

This commit is contained in:
ThomasV
2016-08-15 11:48:33 +02:00
parent 71de14240d
commit d9021788fa
5 changed files with 62 additions and 91 deletions

View File

@@ -3,7 +3,7 @@ from struct import pack
from electrum.i18n import _
from electrum.util import PrintError, UserCancelled
from electrum.keystore import BIP44_KeyStore
from electrum.keystore import bip39_normalize_passphrase
from electrum.bitcoin import EncodeBase58Check
@@ -65,7 +65,7 @@ class GuiMixin(object):
passphrase = self.handler.get_passphrase(msg, self.creating_wallet)
if passphrase is None:
return self.proto.Cancel()
passphrase = BIP44_KeyStore.normalize_passphrase(passphrase)
passphrase = bip39_normalize_passphrase(passphrase)
return self.proto.PassphraseAck(passphrase=passphrase)
def callback_WordRequest(self, msg):

View File

@@ -22,14 +22,13 @@ from ..hw_wallet import HW_PluginBase
TIM_NEW, TIM_RECOVER, TIM_MNEMONIC, TIM_PRIVKEY = range(0, 4)
class TrezorCompatibleKeyStore(Hardware_KeyStore):
root = "m/44'/0'"
account_id = 0
def load(self, storage, name):
self.xpub = storage.get('master_public_keys', {}).get(name)
self.account_id = storage.get('account_id')
def get_derivation(self):
return self.root + "/%d'"%self.account_id
return "m/44'/0'/%d'"%self.account_id
def get_client(self, force_pair=True):
return self.plugin.get_client(self, force_pair)