Skip to content
Snippets Groups Projects
Commit 78d7406c authored by inso's avatar inso
Browse files

Do not commit connector and connection synchron

parent e273b322
Branches
Tags
No related merge requests found
...@@ -155,6 +155,7 @@ class ConnectionConfigController(QObject): ...@@ -155,6 +155,7 @@ class ConnectionConfigController(QObject):
self.view.stacked_pages.setCurrentWidget(self.view.page_connection) self.view.stacked_pages.setCurrentWidget(self.view.page_connection)
connection_identity = await self.step_key connection_identity = await self.step_key
self.model.insert_or_update_connector()
self.view.stacked_pages.setCurrentWidget(self.view.page_services) self.view.stacked_pages.setCurrentWidget(self.view.page_services)
self.view.progress_bar.setValue(0) self.view.progress_bar.setValue(0)
self.view.progress_bar.setMaximum(3) self.view.progress_bar.setMaximum(3)
......
...@@ -54,9 +54,11 @@ Current database is storing {1} network.""".format(node_connector.node.currency, ...@@ -54,9 +54,11 @@ Current database is storing {1} network.""".format(node_connector.node.currency,
self.connection.password = password self.connection.password = password
self.connection.pubkey = SigningKey(self.connection.salt, password, scrypt_params).pubkey self.connection.pubkey = SigningKey(self.connection.salt, password, scrypt_params).pubkey
def insert_or_update_connector(self):
NodesProcessor(self.app.db.nodes_repo).commit_node(self.node_connector.node)
def insert_or_update_connection(self): def insert_or_update_connection(self):
ConnectionsProcessor(self.app.db.connections_repo).commit_connection(self.connection) ConnectionsProcessor(self.app.db.connections_repo).commit_connection(self.connection)
NodesProcessor(self.app.db.nodes_repo).commit_node(self.node_connector.node)
def insert_or_update_identity(self, identity): def insert_or_update_identity(self, identity):
self.identities_processor.insert_or_update_identity(identity) self.identities_processor.insert_or_update_identity(identity)
......
...@@ -46,7 +46,7 @@ async def test_register_empty_blockchain(application, fake_server, bob): ...@@ -46,7 +46,7 @@ async def test_register_empty_blockchain(application, fake_server, bob):
assert_key_parameters_behaviour(connection_config_dialog, bob) assert_key_parameters_behaviour(connection_config_dialog, bob)
QTest.mouseClick(connection_config_dialog.view.button_next, Qt.LeftButton) QTest.mouseClick(connection_config_dialog.view.button_next, Qt.LeftButton)
connection_config_dialog.model.connection.password = bob.password connection_config_dialog.model.connection.password = bob.password
await asyncio.sleep(1) await asyncio.sleep(10)
assert connection_config_dialog.view.stacked_pages.currentWidget() == connection_config_dialog.view.page_services assert connection_config_dialog.view.stacked_pages.currentWidget() == connection_config_dialog.view.page_services
assert len(ConnectionsProcessor.instanciate(application).connections(fake_server.forge.currency)) == 1 assert len(ConnectionsProcessor.instanciate(application).connections(fake_server.forge.currency)) == 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment