[#ValidationState-04] = ValidationState :mrdocs: Template for capturing information about block/transaction validation. This is instantiated by TxValidationState and BlockValidationState for validation information on transactions and blocks respectively. == Synopsis Declared in `<consensus/validation.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Result> class ValidationState; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:ValidationState-04/Error.adoc[`Error`] | Puts the state into the run‐time error mode. | xref:ValidationState-04/GetDebugMessage.adoc[`GetDebugMessage`] | Returns the human‐readable debug message. | xref:ValidationState-04/GetRejectReason.adoc[`GetRejectReason`] | Returns the short rejection reason. | xref:ValidationState-04/GetResult.adoc[`GetResult`] | Returns the recorded result code. | xref:ValidationState-04/Invalid.adoc[`Invalid`] | Marks the state invalid and records the reason and debug message. | xref:ValidationState-04/IsError.adoc[`IsError`] | Returns true if the state was marked with a run‐time error. | xref:ValidationState-04/IsInvalid.adoc[`IsInvalid`] | Returns true if the state was marked invalid by a consensus or policy rule. | xref:ValidationState-04/IsValid.adoc[`IsValid`] | Returns true if no validation failure has been recorded. | xref:ValidationState-04/ToString.adoc[`ToString`] | Formats the state as a human‐readable string. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BlockValidationState.adoc[`BlockValidationState`] | Validation state specialized for block‐level results. | xref:PackageValidationState.adoc[`PackageValidationState`] | Validation state for a package, carrying a PackageValidationResult rejection reason. | xref:TxValidationState.adoc[`TxValidationState`] | Holds the outcome and reason of transaction‐level validation. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#