def handleGetSchemaReq(self, request: Request): author_did = get_read_schema_from(request) schema_name = get_read_schema_name(request) schema_version = get_read_schema_version(request) schema, lastSeqNo, lastUpdateTime, proof = self.getSchema( author=author_did, schemaName=schema_name, schemaVersion=schema_version, with_proof=True) # TODO: we have to do this since SCHEMA has a bit different format than other txns # (it has NAME and VERSION inside DATA, and it's not part of the state value, but state key) if schema is None: schema = {} schema.update({ SCHEMA_NAME: schema_name, SCHEMA_VERSION: schema_version }) return self.make_domain_result(request=request, data=schema, last_seq_no=lastSeqNo, update_time=lastUpdateTime, proof=proof)
def test_get_read_schema_version(read_schema_request): assert '1.0' == get_read_schema_version(read_schema_request)