diff --git a/src/shardeum/verifyAppReceiptData.ts b/src/shardeum/verifyAppReceiptData.ts index e6de550..1cbdb0d 100644 --- a/src/shardeum/verifyAppReceiptData.ts +++ b/src/shardeum/verifyAppReceiptData.ts @@ -105,6 +105,7 @@ export const verifyAppReceiptData = async ( } else result = { valid: true, needToSave: true } if (!validateAppReceiptData(appReceiptData, failedReasons, nestedCounterMessages)) { + result = { valid: false, needToSave: false } return result } @@ -152,6 +153,7 @@ const validateAppReceiptData = (appReceiptData: any, failedReasons = [], nestedC } } +// Use validateAppReceiptData to ensure appReceiptData is valid before calculating its hash with calculateAppReceiptDataHash const calculateAppReceiptDataHash = (appReceiptData: any): string => { return crypto.hashObj(appReceiptData) } \ No newline at end of file