def getDomainReqHandler(self): if self.attributeStore is None: self.attributeStore = self.loadAttributeStore() return DomainReqHandler(self.domainLedger, self.states[DOMAIN_LEDGER_ID], self.reqProcessors, self.getIdrCache(), self.attributeStore, self.bls_bft.bls_store)
def check_make_result(request, should_have_proof): data = {NYM: 'HebGWgHmicPtzr4BTHmSmXkDNL7CngDjYVcxqT5oprMw'} seq_no = 5 txn_time = get_utc_epoch() proof = [b"proof1"] result = DomainReqHandler.make_result(request=request, data=data, last_seq_no=seq_no, update_time=txn_time, proof=proof) assert result # operation part: assert result[TXN_TYPE] == NYM assert result[TARGET_NYM] == 'HebGWgHmicPtzr4BTHmSmXkDNL7CngDjYVcxqT5oprMw' assert result[VERKEY] == '~A43KHjJmjwFX71J1b5p61N' assert result[DATA] == data assert result[f.IDENTIFIER.nm] == request.identifier assert result[f.REQ_ID.nm] == request.reqId assert result[f.SEQ_NO.nm] == seq_no assert result[TXN_TIME] == txn_time # check proof if should_have_proof: assert result[STATE_PROOF] == proof else: assert STATE_PROOF not in result
def init_domain_req_handler(self): return DomainReqHandler(self.domainLedger, self.states[DOMAIN_LEDGER_ID], self.config, self.reqProcessors, self.idrCache, self.attributeStore, self.bls_bft.bls_store, self.write_req_validator, self.db_manager.get_store(TS_LABEL))
def init_domain_req_handler(self): if self.attributeStore is None: self.attributeStore = self.init_attribute_store() return DomainReqHandler(self.domainLedger, self.states[DOMAIN_LEDGER_ID], self.config, self.reqProcessors, self.getIdrCache(), self.attributeStore, self.bls_bft.bls_store, self.getStateTsDbStorage())
def request_handler(bls_store): state = PruningState(KeyValueStorageInMemory()) cache = IdrCache('Cache', KeyValueStorageInMemory()) attr_store = AttributeStore(KeyValueStorageInMemory()) return DomainReqHandler(ledger=None, state=state, requestProcessor=None, idrCache=cache, attributeStore=attr_store, bls_store=bls_store)
def request_handler(bls_store): state = PruningState(KeyValueStorageInMemory()) config_state = PruningState(KeyValueStorageInMemory()) state_serializer = ConstraintsSerializer(domain_state_serializer) cache = IdrCache('Cache', KeyValueStorageInMemory()) attr_store = AttributeStore(KeyValueStorageInMemory()) write_req_validator = WriteRequestValidator( config=FakeSomething(authPolicy=CONFIG_LEDGER_AUTH_POLICY), auth_map=auth_map, cache=cache, config_state=config_state, state_serializer=state_serializer) return DomainReqHandler(ledger=None, state=state, config=None, requestProcessor=None, idrCache=cache, attributeStore=attr_store, bls_store=bls_store, write_req_validator=write_req_validator, ts_store=None)