Example #1
0
def make_schema_exist(schema_request, schema_handler):
    identifier, req_id, operation = get_request_data(schema_request)
    schema_name = get_write_schema_name(schema_request)
    schema_version = get_write_schema_version(schema_request)
    path = SchemaHandler.make_state_path_for_schema(identifier, schema_name,
                                                    schema_version)
    schema_handler.state.set(path,
                             encode_state_value("value", "seqNo", "txnTime"))
Example #2
0
 def get_schema(self,
                author: str,
                schema_name: str,
                schema_version: str,
                is_committed=True,
                with_proof=True) -> (str, int, int, list):
     assert author is not None
     assert schema_name is not None
     assert schema_version is not None
     path = SchemaHandler.make_state_path_for_schema(
         author, schema_name, schema_version)
     try:
         keys, seq_no, last_update_time, proof = self.lookup(
             path, is_committed, with_proof=with_proof)
         return keys, seq_no, last_update_time, proof
     except KeyError:
         return None, None, None, None