Exemple #1
0
def write_manager(db_manager):
    wm = WriteRequestManager(db_manager)
    taa_handler = TxnAuthorAgreementHandler(db_manager)
    taa_aml_handler = TxnAuthorAgreementAmlHandler(db_manager)
    wm.register_req_handler(taa_handler)
    wm.register_req_handler(taa_aml_handler)
    return wm
Exemple #2
0
def txn_author_agreement_handler(tconf, domain_state, config_state):
    data_manager = DatabaseManager()
    handler = TxnAuthorAgreementHandler(data_manager)
    data_manager.register_new_database(handler.ledger_id,
                                       FakeSomething(),
                                       config_state)
    data_manager.register_new_database(DOMAIN_LEDGER_ID,
                                       FakeSomething(),
                                       domain_state)
    return handler
Exemple #3
0
    def _register_config_req_handlers(self):
        taa_aml_handler = TxnAuthorAgreementAmlHandler(database_manager=self.db_manager)
        taa_handler = TxnAuthorAgreementHandler(database_manager=self.db_manager)
        get_taa_aml_handler = GetTxnAuthorAgreementAmlHandler(database_manager=self.db_manager)
        get_taa_handler = GetTxnAuthorAgreementHandler(database_manager=self.db_manager)

        self.write_manager.register_req_handler(taa_aml_handler)
        self.write_manager.register_req_handler(taa_handler)

        self.read_manager.register_req_handler(get_taa_aml_handler)
        self.read_manager.register_req_handler(get_taa_handler)
Exemple #4
0
    def register_config_req_handlers(self):
        taa_aml_handler = TxnAuthorAgreementAmlHandler(database_manager=self.node.db_manager,
                                                       bls_crypto_verifier=self.node.bls_bft.bls_crypto_verifier)
        taa_handler = TxnAuthorAgreementHandler(database_manager=self.node.db_manager,
                                                bls_crypto_verifier=self.node.bls_bft.bls_crypto_verifier)
        get_taa_aml_handler = GetTxnAuthorAgreementAmlHandler(database_manager=self.node.db_manager)
        get_taa_handler = GetTxnAuthorAgreementHandler(database_manager=self.node.db_manager)

        self.node.write_manager.register_req_handler(taa_aml_handler)
        self.node.write_manager.register_req_handler(taa_handler)

        self.node.read_manager.register_req_handler(get_taa_aml_handler)
        self.node.read_manager.register_req_handler(get_taa_handler)
Exemple #5
0
def txn_author_agreement_handler(tconf, domain_state):
    data_manager = DatabaseManager()
    handler = TxnAuthorAgreementHandler(data_manager)
    state = State()
    state.txn_list = {}
    state.get = lambda key, isCommitted=False: state.txn_list.get(key, None)
    state.set = lambda key, value, isCommitted=False: state.txn_list.update(
        {key: value})
    data_manager.register_new_database(handler.ledger_id, FakeSomething(),
                                       state)
    data_manager.register_new_database(DOMAIN_LEDGER_ID, FakeSomething(),
                                       domain_state)
    return handler
    def _register_config_req_handlers(self):
        taa_aml_handler = TxnAuthorAgreementAmlHandler(
            database_manager=self.db_manager)
        taa_handler = TxnAuthorAgreementHandler(
            database_manager=self.db_manager)
        taa_disable_handler = TxnAuthorAgreementDisableHandler(
            database_manager=self.db_manager)
        get_taa_aml_handler = GetTxnAuthorAgreementAmlHandler(
            database_manager=self.db_manager)
        get_taa_handler = GetTxnAuthorAgreementHandler(
            database_manager=self.db_manager)
        ledgers_freeze_handler = LedgersFreezeHandler(
            database_manager=self.db_manager)
        get_frozen_ledgers_handler = GetFrozenLedgersHandler(
            database_manager=self.db_manager)

        self.write_manager.register_req_handler(taa_aml_handler)
        self.write_manager.register_req_handler(taa_handler)
        self.write_manager.register_req_handler(taa_disable_handler)
        self.write_manager.register_req_handler(ledgers_freeze_handler)

        self.read_manager.register_req_handler(get_taa_aml_handler)
        self.read_manager.register_req_handler(get_taa_handler)
        self.read_manager.register_req_handler(get_frozen_ledgers_handler)