async def remove_connection(self, connection): connections_processor = ConnectionsProcessor.instanciate(self) connections_processor.remove_connections(connection) CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys()) IdentitiesProcessor.instanciate(self).cleanup_connection(connection) SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey) DividendsProcessor.instanciate(self).cleanup_connection(connection) TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys()) self.db.commit() self.connection_removed.emit(connection)
def __attrs_post_init__(self): super().__init__() self._blockchain_processor = BlockchainProcessor.instanciate(self.app) self._sources_processor = SourcesProcessor.instanciate(self.app) self._connections_processor = ConnectionsProcessor.instanciate( self.app) self._contacts_processor = ContactsProcessor.instanciate(self.app)
async def remove_connection(self, connection): connections_processor = ConnectionsProcessor.instanciate(self) connections_processor.remove_connections(connection) CertificationsProcessor.instanciate(self).cleanup_connection( connection, connections_processor.pubkeys()) IdentitiesProcessor.instanciate(self).cleanup_connection(connection) SourcesProcessor.instanciate(self).drop_all_of( currency=connection.currency, pubkey=connection.pubkey) DividendsProcessor.instanciate(self).cleanup_connection(connection) TransactionsProcessor.instanciate(self).cleanup_connection( connection, connections_processor.pubkeys()) self.db.commit()
async def remove_connection(self, connection): await self.stop_current_profile() connections_processor = ConnectionsProcessor.instanciate(self) connections_processor.remove_connections(connection) IdentitiesProcessor.instanciate(self).cleanup_connection(connection) CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys()) SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey) DividendsProcessor.instanciate(self).cleanup_connection(connection) TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys()) if not connections_processor.connections(): NodesProcessor.instanciate(self).drop_all(self.currency) self.db.commit() self.start_coroutines()
def instanciate(cls, app): """ Instanciate a blockchain processor :param sakia.app.Application app: the app """ return cls(BmaConnector(NodesProcessor(app.db.nodes_repo), app.parameters), BlockchainProcessor.instanciate(app), IdentitiesProcessor.instanciate(app), CertificationsProcessor.instanciate(app), TransactionsProcessor.instanciate(app), SourcesProcessor.instanciate(app))
def instanciate(cls, app): """ Instanciate a blockchain processor :param sakia.app.Application app: the app """ return cls(BmaConnector(NodesProcessor(app.db.nodes_repo), app.parameters), BlockchainProcessor.instanciate(app), IdentitiesProcessor.instanciate(app), CertificationsProcessor.instanciate(app), TransactionsProcessor.instanciate(app), SourcesProcessor.instanciate(app))
def instanciate_services(self): nodes_processor = NodesProcessor(self.db.nodes_repo) bma_connector = BmaConnector(nodes_processor, self.parameters) connections_processor = ConnectionsProcessor(self.db.connections_repo) identities_processor = IdentitiesProcessor(self.db.identities_repo, self.db.certifications_repo, self.db.blockchains_repo, bma_connector) certs_processor = CertificationsProcessor(self.db.certifications_repo, self.db.identities_repo, bma_connector) blockchain_processor = BlockchainProcessor.instanciate(self) sources_processor = SourcesProcessor.instanciate(self) transactions_processor = TransactionsProcessor.instanciate(self) dividends_processor = DividendsProcessor.instanciate(self) nodes_processor.initialize_root_nodes(self.currency) self.db.commit() self.documents_service = DocumentsService.instanciate(self) self.identities_service = IdentitiesService( self.currency, connections_processor, identities_processor, certs_processor, blockchain_processor, bma_connector) self.transactions_service = TransactionsService( self.currency, transactions_processor, dividends_processor, identities_processor, connections_processor, bma_connector) self.sources_service = SourcesServices( self.currency, sources_processor, connections_processor, transactions_processor, blockchain_processor, bma_connector) self.blockchain_service = BlockchainService(self, self.currency, blockchain_processor, bma_connector, self.identities_service, self.transactions_service, self.sources_service) self.network_service = NetworkService.load(self, self.currency, nodes_processor, self.blockchain_service, self.identities_service)
def instanciate_services(self): nodes_processor = NodesProcessor(self.db.nodes_repo) bma_connector = BmaConnector(nodes_processor, self.parameters) connections_processor = ConnectionsProcessor(self.db.connections_repo) identities_processor = IdentitiesProcessor(self.db.identities_repo, self.db.certifications_repo, self.db.blockchains_repo, bma_connector) certs_processor = CertificationsProcessor(self.db.certifications_repo, self.db.identities_repo, bma_connector) blockchain_processor = BlockchainProcessor.instanciate(self) sources_processor = SourcesProcessor.instanciate(self) transactions_processor = TransactionsProcessor.instanciate(self) dividends_processor = DividendsProcessor.instanciate(self) nodes_processor.initialize_root_nodes(self.currency) self.db.commit() self.documents_service = DocumentsService.instanciate(self) self.identities_service = IdentitiesService(self.currency, connections_processor, identities_processor, certs_processor, blockchain_processor, bma_connector) self.transactions_service = TransactionsService(self.currency, transactions_processor, dividends_processor, identities_processor, connections_processor, bma_connector) self.sources_service = SourcesServices(self.currency, sources_processor, connections_processor, transactions_processor, blockchain_processor, bma_connector) self.blockchain_service = BlockchainService(self, self.currency, blockchain_processor, connections_processor, bma_connector, self.identities_service, self.transactions_service, self.sources_service) self.network_service = NetworkService.load(self, self.currency, nodes_processor, self.blockchain_service, self.identities_service)
def __attrs_post_init__(self): super().__init__() self._blockchain_processor = BlockchainProcessor.instanciate(self.app) self._sources_processor = SourcesProcessor.instanciate(self.app) self._connections_processor = ConnectionsProcessor.instanciate(self.app) self._contacts_processor = ContactsProcessor.instanciate(self.app)