Loading src/dlt/connector/service/tools/Checkers.py +1 −1 Original line number Diff line number Diff line Loading @@ -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 src/dlt/gateway/dltApp/src/dltGateway.js +7 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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({ Loading Loading
src/dlt/connector/service/tools/Checkers.py +1 −1 Original line number Diff line number Diff line Loading @@ -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
src/dlt/gateway/dltApp/src/dltGateway.js +7 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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({ Loading