Esempio n. 1
0
    async def submitPublicKeys(self,
                               id: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None,
                               signatureType = 'CL') -> \
            (PublicKey, RevocationPublicKey):

        data = {}
        if pk is not None:
            data[PRIMARY] = pk.toStrDict()
        if pkR is not None:
            data[REVOCATION] = pkR.toStrDict()

        op = {
            TXN_TYPE: CLAIM_DEF,
            REF: id.schemaId,
            DATA: JsonSerializer.dumps(data, toBytes=False),
            SIGNATURE_TYPE: signatureType
        }

        _, seqNo = await self._sendSubmitReq(op)

        if seqNo:
            pk = pk._replace(seqId=seqNo)

            if pkR is not None:
                pkR = pkR._replace(seqId=seqNo)

            return pk, pkR
Esempio n. 2
0
    async def submitPublicKeys(self,
                               id: ID,
                               pk: PublicKey,
                               pkR: RevocationPublicKey = None,
                               signatureType = 'CL') -> \
            (PublicKey, RevocationPublicKey):

        data = {}
        if pk is not None:
            data[PRIMARY] = pk.to_str_dict()
        if pkR is not None:
            data[REVOCATION] = pkR.toStrDict()

        op = {
            TXN_TYPE: CLAIM_DEF,
            REF: id.schemaId,
            DATA: JsonSerializer.dumps(data, toBytes=False),
            SIGNATURE_TYPE: signatureType
        }

        _, seqNo = await self._sendSubmitReq(op)

        if seqNo:
            pk = pk._replace(seqId=seqNo)

            if pkR is not None:
                pkR = pkR._replace(seqId=seqNo)

            return pk, pkR
Esempio n. 3
0
 async def submitSchema(self, schema: Schema) -> Schema:
     data = {
         NAME: schema.name,
         VERSION: schema.version,
         ATTR_NAMES: ",".join(schema.attrNames)
     }
     op = {
         TXN_TYPE: SCHEMA,
         DATA: JsonSerializer.dumps(data, toBytes=False)
     }
     _, seqNo = await self._sendSubmitReq(op)
     if seqNo:
         schema = schema._replace(issuerId=self.wallet.defaultId,
                                  seqId=seqNo)
         return schema
Esempio n. 4
0
 async def submitSchema(self,
                        schema: Schema) -> Schema:
     data = {
         NAME: schema.name,
         VERSION: schema.version,
         ATTR_NAMES: schema.attrNames
     }
     op = {
         TXN_TYPE: SCHEMA,
         DATA: JsonSerializer.dumps(data, toBytes=False)
     }
     _, seqNo = await self._sendSubmitReq(op)
     if seqNo:
         schema = schema._replace(issuerId=self.wallet.defaultId,
                                  seqId=seqNo)
         return schema