Details
-
Sub-task
-
Status: Closed
-
Medium
-
Resolution: Done
-
None
-
None
-
None
Description
We want to switch valid from a boolean to an enum, so that we can indicate the reason for the invalidation (txid already exists, vscc validation failure (endorsement policy failure), mvcc validation failure, etc
This CR provides new features to persist and get transaction validation results as reason codes.
Before this CR validation results was saved in a bit array with values True or False. Now they are persisted in uint8 array, which represented as TxValidationFlags object.
Also reason codes can be populated with ledger method GetTxValidationResultByTxID. They have high availability because are stored in index (blockindex). Besides this now method GetTransactionByID fills ProcessedTransaction.Valid field with a reason code.