diff --git a/src/dlt/connector/service/tools/Checkers.py b/src/dlt/connector/service/tools/Checkers.py index 94a10d4096b4acb1756ad1c7297faa9c96e07880..6ad0f4b82626740c594829831b08fcefbc15096d 100644 --- a/src/dlt/connector/service/tools/Checkers.py +++ b/src/dlt/connector/service/tools/Checkers.py @@ -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 diff --git a/src/dlt/gateway/dltApp/src/dltGateway.js b/src/dlt/gateway/dltApp/src/dltGateway.js index 0dcfb7508a66c506f57393dca21ffcdb7381702c..ba9a67a31555308565aea9d81573abe6ee3ab71a 100644 --- a/src/dlt/gateway/dltApp/src/dltGateway.js +++ b/src/dlt/gateway/dltApp/src/dltGateway.js @@ -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({