Commit 22ffe9d0 authored by Javier Diaz's avatar Javier Diaz
Browse files

Debugging

parent 4371a083
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,5 +20,5 @@ def record_exists(record : DltRecord) -> bool:
    exists = exists and (record.record_id.type != DLTRECORDTYPE_UNDEFINED)
    exists = exists and (len(record.record_id.record_uuid.uuid) > 0)
    #exists = exists and (record.operation != DLTRECORDOPERATION_UNDEFINED)
    #exists = exists and (len(record.data_json) > 0)
    exists = exists and (len(record.data_json) > 0)
    return exists
+7 −2
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ async function getFromDlt(call, callback) {
  try {

    console.log("RECEIVED CALL REQUEST:", call.request);
    const { record_uuid } = call.request;
    //const { record_id, operation, data_json } = call.request;
    const resultBytes = await contractInstance.evaluateTransaction('RetrieveRecord', JSON.stringify(call.request));
    // Decode and parse the result
    const resultJson = utf8Decoder.decode(resultBytes);
@@ -105,7 +105,12 @@ async function getFromDlt(call, callback) {
   if (error.message.includes("data not found for key")) {
    // Return an empty response when no record is found
    console.log("REQUEST ERROR:", error);
    callback(null, { record_id: call.request, data_json: "" });
    const emptyRecordId = {
      domain_uuid: { uuid: "" },
      type: 'DLTRECORDTYPE_UNDEFINED',
      record_uuid: { uuid: "" }
    };
    callback(null, { record_id: emptyRecordId, data_json: "" });
  } else {
    // Send failure response with error message
    callback({