Trait tuxedo_core::verifier::Verifier
source · pub trait Verifier: Debug + Encode + Decode + Clone {
type Redeemer: Debug + Encode + Decode;
// Required method
fn verify(
&self,
simplified_tx: &[u8],
block_height: u32,
redeemer: &Self::Redeemer
) -> bool;
// Provided method
fn new_unspendable() -> Option<Self> { ... }
}
Expand description
A means of checking that an output can be spent. This check is made on a per-output basis and neither knows nor cares anything about the validation logic that will be applied to the transaction as a whole. Nonetheless, in order to avoid malleability, we we take the entire stripped and serialized transaction as a parameter.
Information available when verifying an input includes:
- The simplified transaction - a stripped encoded version of the transaction
- Some environmental information such as the block current block number
- An redeemer supplied by the user attempting to spend the input.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn new_unspendable() -> Option<Self>
fn new_unspendable() -> Option<Self>
A way to create a new instance of the verifier whose semantics cannot be spent. This may be a signature check with a pubkey of 0 or a hashlock with a hash o 0 or a bitcoin script that directly returns false, etc.
This is only required in chains that use inherents, and thus a default implementation is provided.
Object Safety§
This trait is not object safe.