electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit c47e3499ce051cf76e1850c092c8bfc751ea7d05
parent 450ab76f78db2fefea126b61b20d227b3c81f9c4
Author: ThomasV <thomasv@electrum.org>
Date:   Sun, 10 Jan 2016 12:56:15 +0100

rename wallet methods

Diffstat:
Mlib/wallet.py | 14+++++++-------
Mplugins/ledger/ledger.py | 2+-
Mplugins/trezor/plugin.py | 2+-
Mplugins/trustedcoin/trustedcoin.py | 8++++----
4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/lib/wallet.py b/lib/wallet.py @@ -1611,10 +1611,6 @@ class BIP32_Wallet(Deterministic_Wallet): xprv, xpub = bip32_private_derivation(root_xprv, root, derivation) return xpub, xprv - def create_master_keys(self, password): - seed = self.get_seed(password) - self.add_cosigner_seed(seed, self.root_name, password) - def mnemonic_to_seed(self, seed, password): return Mnemonic.mnemonic_to_seed(seed, password) @@ -1661,19 +1657,23 @@ class BIP32_RD_Wallet(BIP32_Wallet): acc_id, (change, address_index) = self.get_address_index(address) return self.address_derivation(acc_id, change, address_index) - def add_cosigner_seed(self, seed, name, password, passphrase=''): + def add_xprv_from_seed(self, seed, name, password, passphrase=''): # we don't store the seed, only the master xpriv xprv, xpub = bip32_root(self.mnemonic_to_seed(seed, passphrase)) xprv, xpub = bip32_private_derivation(xprv, "m/", self.root_derivation) self.add_master_public_key(name, xpub) self.add_master_private_key(name, xprv, password) - def add_cosigner_xpub(self, seed, name): + def add_xpub_from_seed(self, seed, name): # store only master xpub xprv, xpub = bip32_root(self.mnemonic_to_seed(seed,'')) xprv, xpub = bip32_private_derivation(xprv, "m/", self.root_derivation) self.add_master_public_key(name, xpub) + def create_master_keys(self, password): + seed = self.get_seed(password) + self.add_xprv_from_seed(seed, self.root_name, password) + class BIP32_HD_Wallet(BIP32_RD_Wallet): # Abstract base class for a BIP32 wallet that admits account creation @@ -2095,7 +2095,7 @@ class Wallet(object): wallet.add_seed(text, password) wallet.create_master_keys(password) else: - wallet.add_cosigner_seed(text, name, password) + wallet.add_xprv_from_seed(text, name, password) else: raise RunTimeError("Cannot handle text for multisig") wallet.set_use_encryption(password is not None) diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py @@ -426,7 +426,7 @@ class LedgerPlugin(BasePlugin): passphrase = unicode() password = wizard.request_password() wallet.add_seed(seed, password) - wallet.add_cosigner_seed(seed, 'x/', password, passphrase) + wallet.add_xprv_from_seed(seed, 'x/', password, passphrase) wallet.create_hd_account(password) return wallet diff --git a/plugins/trezor/plugin.py b/plugins/trezor/plugin.py @@ -339,7 +339,7 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob): passphrase = wizard.request_passphrase(self.device, restore=True) password = wizard.request_password() wallet.add_seed(seed, password) - wallet.add_cosigner_seed(seed, 'x/', password, passphrase) + wallet.add_xprv_from_seed(seed, 'x/', password, passphrase) wallet.create_hd_account(password) return wallet diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py @@ -330,8 +330,8 @@ class TrustedCoinPlugin(BasePlugin): words = seed.split() n = len(words)/2 - wallet.add_cosigner_seed(' '.join(words[0:n]), 'x1/', password) - wallet.add_cosigner_xpub(' '.join(words[n:]), 'x2/') + wallet.add_xprv_from_seed(' '.join(words[0:n]), 'x1/', password) + wallet.add_xpub_from_seed(' '.join(words[n:]), 'x2/') wallet.storage.write() @@ -360,8 +360,8 @@ class TrustedCoinPlugin(BasePlugin): wallet.add_seed(seed, password) words = seed.split() n = len(words)/2 - wallet.add_cosigner_seed(' '.join(words[0:n]), 'x1/', password) - wallet.add_cosigner_seed(' '.join(words[n:]), 'x2/', password) + wallet.add_xprv_from_seed(' '.join(words[0:n]), 'x1/', password) + wallet.add_xpub_from_seed(' '.join(words[n:]), 'x2/', password) restore_third_key(wallet) wallet.create_main_account()