def on_restore_pw(self, wizard, seed, password): # FIXME # wallet.add_seed(seed, password) storage = wizard.storage words = seed.split() n = len(words)/2 keystore1 = keystore.xprv_from_seed(' '.join(words[0:n]), password) keystore2 = keystore.xprv_from_seed(' '.join(words[n:]), password) keystore1.save(storage, 'x1/') keystore2.save(storage, 'x2/') long_user_id, short_id = get_user_id(storage) xpub3 = make_xpub(signing_xpub, long_user_id) keystore3 = keystore.from_xpub(xpub3) keystore3.save(storage, 'x3/') wizard.wallet = Wallet(storage) wizard.create_addresses()
def on_restore_pw(self, wizard, seed, password): # FIXME # wallet.add_seed(seed, password) storage = wizard.storage words = seed.split() n = len(words) / 2 keystore1 = keystore.xprv_from_seed(' '.join(words[0:n]), password) keystore2 = keystore.xprv_from_seed(' '.join(words[n:]), password) keystore1.save(storage, 'x1/') keystore2.save(storage, 'x2/') long_user_id, short_id = get_user_id(storage) xpub3 = make_xpub(signing_xpub, long_user_id) keystore3 = keystore.from_xpub(xpub3) keystore3.save(storage, 'x3/') wizard.wallet = Wallet(storage) wizard.create_addresses()
def create_keystore(self, wizard, seed, password): # this overloads the wizard's method words = seed.split() n = len(words) / 2 keystore1 = keystore.xprv_from_seed(' '.join(words[0:n]), password) keystore2 = keystore.xpub_from_seed(' '.join(words[n:])) wizard.storage.put('x1/', keystore1.dump()) wizard.storage.put('x2/', keystore2.dump()) wizard.storage.write() msg = [ _("Your wallet file is: %s.") % os.path.abspath(wizard.storage.path), _("You need to be online in order to complete the creation of " "your wallet. If you generated your seed on an offline " 'computer, click on "%s" to close this window, move your ' "wallet file to an online computer, and reopen it with " "Electrum.") % _('Cancel'), _('If you are online, click on "%s" to continue.') % _('Next') ] msg = '\n\n'.join(msg) wizard.stack = [] wizard.confirm_dialog( title='', message=msg, run_next=lambda x: wizard.run('create_remote_key'))
def on_restore_pw(self, wizard, seed, password): storage = wizard.storage words = seed.split() n = len(words) / 2 k1 = keystore.xprv_from_seed(' '.join(words[0:n])) k2 = keystore.xprv_from_seed(' '.join(words[n:])) k1.add_seed(seed) k1.update_password(None, password) k2.update_password(None, password) storage.put('x1/', k1.dump()) storage.put('x2/', k2.dump()) long_user_id, short_id = get_user_id(storage) xpub3 = make_xpub(signing_xpub, long_user_id) k3 = keystore.from_xpub(xpub3) storage.put('use_encryption', bool(password)) storage.put('x3/', k3.dump()) wizard.wallet = Wallet_2fa(storage) wizard.create_addresses()
def create_keystore(self, wizard, seed, passphrase): assert passphrase == '' # this overloads the wizard's method words = seed.split() n = len(words) / 2 k1 = keystore.xprv_from_seed(' '.join(words[0:n])) k2 = keystore.xpub_from_seed(' '.join(words[n:])) wizard.request_password( run_next=lambda pw: self.on_password(wizard, pw, k1, k2))
def create_keystore(self, wizard, seed, password): # this overloads the wizard's method words = seed.split() n = len(words)/2 keystore1 = keystore.xprv_from_seed(' '.join(words[0:n]), password) keystore2 = keystore.xpub_from_seed(' '.join(words[n:])) keystore1.save(wizard.storage, 'x1/') keystore2.save(wizard.storage, 'x2/') wizard.storage.write() msg = [ _("Your wallet file is: %s.")%os.path.abspath(wizard.storage.path), _("You need to be online in order to complete the creation of " "your wallet. If you generated your seed on an offline " 'computer, click on "%s" to close this window, move your ' "wallet file to an online computer, and reopen it with " "Electrum.") % _('Cancel'), _('If you are online, click on "%s" to continue.') % _('Next') ] msg = '\n\n'.join(msg) wizard.stack = [] wizard.confirm_dialog(msg, run_next = lambda x: wizard.run('create_remote_key'))