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§
Required Methods§
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.
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.
type Verified = SignedBlock
type Error = VerificationError
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.
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.
type Verified = ProvenBatch
type Error = VerificationError
Source§impl VerifyWith<u32> for ProposedBatch
Verifies transaction proofs and batch consistency, not trust in the supplied reference chain.
impl VerifyWith<u32> for ProposedBatch
Verifies transaction proofs and batch consistency, not trust in the supplied reference chain.