def test_keyring(self): timestamp = str(time.time()) keyring.set_password(service='test_entry', username=timestamp, password='******') password = keyring.get_password(service='test_entry', username=timestamp) assert password == 'test_password' keyring.delete_password(service='test_entry', username=timestamp)
def auto_unlock_wallet(self): password = keyring.get_password( service=f'lnd_{self.node_set.network}_wallet_password', username=self.node_set.bitcoin.file['rpcuser'], ) if password is not None: worker = Worker(fn=self.lnd_poll, lnd=self.node_set.lnd, password=password) worker.signals.result.connect(self.handle_lnd_poll) self.threadpool.start(worker)
def auto_unlock_wallet(self): keyring_service_name = f'lnd_mainnet_wallet_password' keyring_user_name = self.lnd.file['bitcoind.rpcuser'] log.info('auto_unlock_wallet_get_password', keyring_service_name=keyring_service_name, keyring_user_name=keyring_user_name) password = keyring.get_password( service=keyring_service_name, username=keyring_user_name, ) worker = Worker(fn=self.unlock_wallet, lnd=self.lnd, password=password) worker.signals.result.connect(self.handle_unlock_wallet) self.threadpool.start(worker)
def refresh(self): self.node_set.bitcoin.process = self.node_set.bitcoin.find_running_node( ) self.node_set.lnd.process = self.node_set.lnd.find_running_node() self.nodes_layout.bitcoin_qt_button.setDisabled( self.node_set.bitcoin.running) self.cli_layout.copy_bitcoin_cli.button.setEnabled( self.node_set.bitcoin.running) disable_lnd_launch = self.node_set.lnd.running or not self.node_set.bitcoin.running self.nodes_layout.lnd_button.setDisabled(disable_lnd_launch) if self.node_set.lnd.running and not self.node_set.lnd.is_unlocked: password = keyring.get_password( service=f'lnd_{self.node_set.network}_wallet_password', username=self.node_set.bitcoin.file['rpcuser'], ) if password is None: password = '******' worker = Worker(self.lnd_poll, lnd=self.node_set.lnd, password=password) worker.signals.result.connect(self.handle_lnd_poll) self.threadpool.start(worker) elif self.node_set.lnd.running and self.node_set.lnd.is_unlocked: self.set_open_state() elif not self.node_set.lnd.running: self.node_set.lnd.is_unlocked = False self.set_closed_state() self.cli_layout.copy_lncli.button.setEnabled( self.node_set.lnd.is_unlocked) self.zap_layout.open_zap_desktop_button.setEnabled( self.node_set.lnd.is_unlocked) self.zap_layout.show_zap_qrcode_button.setEnabled( self.node_set.lnd.is_unlocked) self.joule_layout.copy_rest.button.setEnabled( self.node_set.lnd.is_unlocked) self.joule_layout.show_macaroons_button.setEnabled( self.node_set.lnd.is_unlocked)
def auto_unlock_wallet(self): keyring_service_name = f'lnd_mainnet_wallet_password' keyring_user_name = self.configuration['bitcoind.rpcuser'] log.info( 'auto_unlock_wallet_get_password', keyring_service_name=keyring_service_name, keyring_user_name=keyring_user_name ) password = keyring.get_password( service=keyring_service_name, username=keyring_user_name, ) worker = Worker( fn=self.unlock_wallet, configuration=self.configuration, password=password ) worker.signals.result.connect(self.handle_unlock_wallet) QThreadPool().start(worker)