Exemplo n.º 1
0
 async def submitSchema(self,
                        schema: Schema) -> Schema:
     schema = schema._replace(seqId=self._schemaId)
     self._schemaId += 1
     self._schemasByKey[schema.getKey()] = schema
     self._schemasById[schema.seqId] = schema
     return schema
Exemplo n.º 2
0
 async def submitSchema(self, schema: Schema) -> Schema:
     data = {
         NAME: schema.name,
         VERSION: schema.version,
         ATTR_NAMES: schema.attrNames
     }
     op = {TXN_TYPE: SCHEMA, DATA: data}
     _, seqNo = await self._sendSubmitReq(op)
     if seqNo:
         schema = schema._replace(issuerId=self.wallet.defaultId,
                                  seqId=seqNo)
         return schema
Exemplo n.º 3
0
 async def submitSchema(self, schema: Schema) -> Schema:
     op = {
         TXN_TYPE: SCHEMA,
         DATA: {
             NAME: schema.name,
             VERSION: schema.version,
             ATTR_NAMES: ",".join(schema.attrNames)
         }
     }
     data, seqNo = await self._sendSubmitReq(op)
     if not seqNo:
         return None
     schema = schema._replace(issuerId=self.wallet.defaultId, seqId=seqNo)
     return schema
Exemplo n.º 4
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
Exemplo n.º 5
0
 async def submitSchema(self,
                        schema: Schema) -> Schema:
     data = {
         NAME: schema.name,
         VERSION: schema.version,
         ATTR_NAMES: schema.attrNames
     }
     op = {
         TXN_TYPE: SCHEMA,
         DATA: data
     }
     _, seqNo = await self._sendSubmitReq(op)
     if seqNo:
         schema = schema._replace(issuerId=self.wallet.defaultId,
                                  seqId=seqNo)
         return schema
Exemplo n.º 6
0
    async def submitSchema(self, schema: Schema) -> Schema:
        op = {
            TXN_TYPE: SCHEMA,
            DATA: {
                NAME: schema.name,
                VERSION: schema.version,
                TYPE: schema.schemaType,
                ATTR_NAMES: ",".join(schema.attrNames)
            }
        }

        try:
            data, seqNo = await self._sendSubmitReq(op)
        except TimeoutError:
            logger.error('Operation timed out {}'.format(op))
            return None

        if not seqNo:
            return None
        schema = schema._replace(issuerId=self.wallet.defaultId, seqId=seqNo)
        return schema