Skip to content

Commit

Permalink
Added the before/after account hash exist check in the appliedReceipt
Browse files Browse the repository at this point in the history
  • Loading branch information
jairajdev committed Jun 17, 2024
1 parent e4e0405 commit a270ead
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/shardeum/verifyAppReceiptData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export const verifyAppReceiptData = async (
appliedReceipt.appliedVote.account_state_hash_after.length > 0
) {
for (let i = 0; i < appliedReceipt.appliedVote.account_id.length; i++) {
if (
!appliedReceipt.appliedVote.account_state_hash_before[i] ||
!appliedReceipt.appliedVote.account_state_hash_after[i]
) {
Logger.mainLogger.error(
`The account state hash before or after is missing in the receipt! ${receipt.tx.txId} , ${receipt.cycle} , ${receipt.tx.timestamp}`
)
}
if (
// eslint-disable-next-line security/detect-object-injection
appliedReceipt.appliedVote.account_state_hash_before[i] !==
Expand Down

0 comments on commit a270ead

Please sign in to comment.