def make_context_exist(context_request, context_handler): identifier, req_id, operation = get_request_data(context_request) context_name = get_write_context_name(context_request) context_version = get_write_context_version(context_request) path = ContextHandler.make_state_path_for_context(identifier, context_name, context_version) context_handler.state.set(path, encode_state_value("value", "seqNo", "txnTime"))
def get_context(self, author: str, context_name: str, context_version: str, is_committed=True, with_proof=True) -> (str, int, int, list): assert author is not None assert context_name is not None assert context_version is not None path = ContextHandler.make_state_path_for_context(author, context_name, context_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