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. Implementations are handwritten; decoding does not invoke verification.
Boxes delegate to the contained verifier without cloning the context or changing its error.
The collection field wrappers also implement this trait, retaining field, index, and key
context as with Verify. For vectors and maps, context is cloned once per element; pass
&context to share a context without cloning its contents.
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".
Implementations on Foreign Types§
Source§impl<S, C> VerifyWith<C> for Box<S>where
S: VerifyWith<C>,
impl<S, C> VerifyWith<C> for Box<S>where
S: VerifyWith<C>,
type Verified = Box<<S as VerifyWith<C>>::Verified>
type Error = <S as VerifyWith<C>>::Error
fn verify_with( self, context: C, ) -> Result<<Box<S> as VerifyWith<C>>::Verified, <Box<S> as VerifyWith<C>>::Error>
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.
type Verified = ProposedBatch
type Error = VerificationError
Source§impl<K, S, C> VerifyWith<C> for MapField<BTreeMap<K, S>>
impl<K, S, C> VerifyWith<C> for MapField<BTreeMap<K, S>>
type Verified = BTreeMap<K, <S as VerifyWith<C>>::Verified>
type Error = ConversionError
Source§impl<K, S, C> VerifyWith<C> for MapField<HashMap<K, S>>
Available on crate feature std only.
impl<K, S, C> VerifyWith<C> for MapField<HashMap<K, S>>
std only.