Trait zcash_primitives::extensions::transparent::Extension [−][src]
pub trait Extension<C> { type Precondition; type Witness; type Error; fn verify_inner(
&self,
precondition: &Self::Precondition,
witness: &Self::Witness,
context: &C
) -> Result<(), Self::Error>; fn verify(
&self,
precondition: &Precondition,
witness: &Witness<AuthData>,
context: &C
) -> Result<(), Self::Error>
where
Self::Precondition: FromPayload<Error = Self::Error>,
Self::Witness: FromPayload<Error = Self::Error>, { ... } }
Expand description
This is the primary trait which must be implemented by an extension type for that type to be eligible for inclusion in Zcash consensus rules.
Associated Types
type Precondition
type Precondition
Extension-specific precondition type. The extension will need to implement
[FromPayload<Error = Self::Error>
] for this type in order for their extension to be
eligible for integration into consensus rules.
Extension-specific witness type. The extension will need to implement [FromPayload<Error = Self::Error>
] for this type in order for their extension to be eligible for integration
into consensus rules.
Required methods
fn verify_inner(
&self,
precondition: &Self::Precondition,
witness: &Self::Witness,
context: &C
) -> Result<(), Self::Error>
fn verify_inner(
&self,
precondition: &Self::Precondition,
witness: &Self::Witness,
context: &C
) -> Result<(), Self::Error>
This is the primary method that an extension must implement. Implementations should return
[Ok(())
] if verification of the witness succeeds against the supplied precondition, and
an error in any other case.
Provided methods
fn verify(
&self,
precondition: &Precondition,
witness: &Witness<AuthData>,
context: &C
) -> Result<(), Self::Error> where
Self::Precondition: FromPayload<Error = Self::Error>,
Self::Witness: FromPayload<Error = Self::Error>,
fn verify(
&self,
precondition: &Precondition,
witness: &Witness<AuthData>,
context: &C
) -> Result<(), Self::Error> where
Self::Precondition: FromPayload<Error = Self::Error>,
Self::Witness: FromPayload<Error = Self::Error>,
This is a convenience method intended for use by consensus nodes at the integration point
to provide easy interoperation with the opaque, cross-extension Precondition
and
Witness
types.