Exemple #1
0
    async def _sendReq(self, op, clbk):
        req = Request(identifier=self.wallet.defaultId, operation=op)
        req = self.wallet.prepReq(req)
        self.client.submitReqs(req)

        return await eventually(_ensureReqCompleted,
                                req.key,
                                self.client,
                                clbk,
                                timeout=20,
                                retryWait=0.5)
Exemple #2
0
 async def _sendReq(self, op, clbk):
     req = Request(identifier=self.wallet.defaultId, operation=op)
     req = self.wallet.prepReq(req)
     self.client.submitReqs(req)
     try:
         resp = await eventually(_ensureReqCompleted,
                                 req.key, self.client, clbk,
                                 timeout=20, retryWait=0.5)
     except NoConsensusYet:
         raise TimeoutError('Request timed out')
     return resp
Exemple #3
0
 def request(self):
     if not self.seqNo:
         assert self.origin is not None
         op = {
             TXN_TYPE: CRED_DEF,
             DATA: {
                 NAME: self.name,
                 VERSION: self.version,
                 TYPE: self.typ,
                 ATTR_NAMES: ",".join(self.attrNames)
             }
         }
         return Request(identifier=self.origin, operation=op)
Exemple #4
0
 def request(self):
     if not self.seqNo:
         assert self.origin is not None
         R_str = {k: str(v) for k, v in self.R.items()}
         op = {
             TXN_TYPE: ISSUER_KEY,
             REFERENCE: self.claimDefSeqNo,
             DATA: {
                 "N": str(self.N),
                 "R": R_str,
                 "S": str(self.S),
                 "Z": str(self.Z)
             }
         }
         return Request(identifier=self.origin, operation=op)
Exemple #5
0
 def ledgerRequest(self):
     if not self.seqNo:
         return Request(identifier=self.trustee, operation=self._op())
Exemple #6
0
 def getRequest(self, requestAuthor: Identifier):
     if not self.seqNo:
         return Request(identifier=requestAuthor,
                        operation=self._opForGet())
Exemple #7
0
 def ledgerRequest(self):
     if self.ledgerStore.isWriting and not self.seqNo:
         assert self.origin is not None
         return Request(identifier=self.origin, operation=self._op())
Exemple #8
0
 def ledgerRequest(self):
     if not self.seqNo:
         assert self.identifier is not None
         return Request(identifier=self.sponsor, operation=self._op())