def on_password(self, wizard, password, encrypt_storage, k1, k2):
     k1.update_password(None, password)
     wizard.data['x1/'] = k1.dump()
     wizard.data['x2/'] = k2.dump()
     wizard.pw_args = WizardWalletPasswordSetting(password=password,
                                                  encrypt_storage=encrypt_storage,
                                                  storage_enc_version=StorageEncryptionVersion.USER_PASSWORD,
                                                  encrypt_keystore=bool(password))
     self.go_online_dialog(wizard)
 def on_restore_pw(self, wizard, seed, passphrase, password, encrypt_storage):
     xprv1, xpub1, xprv2, xpub2 = self.xkeys_from_seed(seed, passphrase)
     k1 = keystore.from_xprv(xprv1)
     k2 = keystore.from_xprv(xprv2)
     k1.add_seed(seed)
     k1.update_password(None, password)
     k2.update_password(None, password)
     wizard.data['x1/'] = k1.dump()
     wizard.data['x2/'] = k2.dump()
     long_user_id, short_id = get_user_id(wizard.data)
     xtype = xpub_type(xpub1)
     xpub3 = make_xpub(get_signing_xpub(xtype), long_user_id)
     k3 = keystore.from_xpub(xpub3)
     wizard.data['x3/'] = k3.dump()
     wizard.pw_args = WizardWalletPasswordSetting(password=password,
                                                  encrypt_storage=encrypt_storage,
                                                  storage_enc_version=StorageEncryptionVersion.USER_PASSWORD,
                                                  encrypt_keystore=bool(password))
     wizard.terminate()