Skip to main content

VerifyWith

Trait VerifyWith 

Source
pub trait VerifyWith<C>: Sized {
    type Verified;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn verify_with(self, context: C) -> Result<Self::Verified, Self::Error>;
}
Expand description

Checks domain invariants using caller-supplied context and constructs the verified type.

Context can be borrowed, such as a trusted parent header, or owned, such as a security level. Use a named context struct when verification needs several inputs. Implementations must document any trust requirements on the context.

This capability is independent of Verify: implementing it does not provide context-free verification. As with Verify, errors belong to the domain and do not receive generated wire paths. Implementations are handwritten; decoding does not invoke verification.

Required Associated Types§

Source

type Verified

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn verify_with(self, context: C) -> Result<Self::Verified, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl VerifyWith<&BlockHeader> for SignedBlock

Authenticates the block against an already-trusted parent, in addition to self-consistency. This does not re-execute transactions or validate the account/nullifier state transition.

Source§

impl VerifyWith<&ProposedBatch> for ProvenBatch

Checks all fields duplicated from an already-verified proposal. The batch execution proof still needs verification by the consuming service; this only establishes proposal agreement.

Source§

impl VerifyWith<u32> for ProposedBatch

Verifies transaction proofs and batch consistency, not trust in the supplied reference chain.