Skip to main content

VerificationResult

Struct VerificationResult 

Source
pub struct VerificationResult {
    pub body_hash_matches: bool,
    pub receipt_well_formed: bool,
    pub algorithms_match_flags: bool,
    pub timestamps_agree: bool,
    pub flags_from_receipt: Option<AlgorithmFlags>,
    pub computed_body_hash: [u8; 32],
}
Expand description

Structured verdict from running the four structural checks.

Every field is a boolean, and every field answers a distinct, independently-valuable question. Self::is_valid is simply the AND of all four; callers that want partial verdicts (e.g. “body is bound and the receipt is structurally valid, but the algorithms header was stripped”) can read the fields directly.

The four booleans map one-to-one to the four independent integrity checks and deliberately do not collapse into a state-machine enum: a caller often wants to surface a specific check that failed in a log or UI, and an enum would flatten that information.

Fields§

§body_hash_matches: bool

true if SHA3-256(body) == X-H33-Substrate.

§receipt_well_formed: bool

true if X-H33-Receipt decoded to a v1 42-byte receipt with recognized algorithm flags.

§algorithms_match_flags: bool

true if the algorithm names listed in X-H33-Algorithms correspond exactly (set-equal) to the algorithm flags inside the receipt.

§timestamps_agree: bool

true if X-H33-Substrate-Ts equals the verified_at_ms field inside the receipt.

§flags_from_receipt: Option<AlgorithmFlags>

Typed view of the algorithm flags byte from the decoded receipt. Populated as soon as the receipt itself parses, even if the other checks fail.

§computed_body_hash: [u8; 32]

The 32-byte SHA3-256 hash this verifier computed over the body, surfaced so callers can log it alongside pass/fail.

Implementations§

Source§

impl VerificationResult

Source

pub const fn is_valid(&self) -> bool

The overall verdict: true only when every structural check passes.

Source

pub const fn summary(&self) -> &'static str

A short human-readable description of which check failed first. Useful in CLI output and logs. Returns "verified" when every check passed.

Trait Implementations§

Source§

impl Clone for VerificationResult

Source§

fn clone(&self) -> VerificationResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VerificationResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for VerificationResult

Source§

fn eq(&self, other: &VerificationResult) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for VerificationResult

Source§

impl StructuralPartialEq for VerificationResult

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.