[#ValidationState-04]
= ValidationState
:mrdocs:

Template for capturing information about block&sol;transaction validation&period; This is instantiated by TxValidationState and BlockValidationState for validation information on transactions and blocks respectively&period;

== Synopsis

Declared in `&lt;consensus&sol;validation&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Result&gt;
class ValidationState;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:ValidationState-04/Error.adoc[`Error`] 
| Puts the state into the run&hyphen;time error mode&period;
| xref:ValidationState-04/GetDebugMessage.adoc[`GetDebugMessage`] 
| Returns the human&hyphen;readable debug message&period;
| xref:ValidationState-04/GetRejectReason.adoc[`GetRejectReason`] 
| Returns the short rejection reason&period;
| xref:ValidationState-04/GetResult.adoc[`GetResult`] 
| Returns the recorded result code&period;
| xref:ValidationState-04/Invalid.adoc[`Invalid`] 
| Marks the state invalid and records the reason and debug message&period;
| xref:ValidationState-04/IsError.adoc[`IsError`] 
| Returns true if the state was marked with a run&hyphen;time error&period;
| xref:ValidationState-04/IsInvalid.adoc[`IsInvalid`] 
| Returns true if the state was marked invalid by a consensus or policy rule&period;
| xref:ValidationState-04/IsValid.adoc[`IsValid`] 
| Returns true if no validation failure has been recorded&period;
| xref:ValidationState-04/ToString.adoc[`ToString`] 
| Formats the state as a human&hyphen;readable string&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BlockValidationState.adoc[`BlockValidationState`] 
| Validation state specialized for block&hyphen;level results&period;
| xref:PackageValidationState.adoc[`PackageValidationState`] 
| Validation state for a package, carrying a PackageValidationResult rejection reason&period;
| xref:TxValidationState.adoc[`TxValidationState`] 
| Holds the outcome and reason of transaction&hyphen;level validation&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
