pub trait TapScriptClause: Sized + Clone {
type WitnessData;
// Required methods
fn tapscript(&self) -> ScriptBuf;
fn witness_size(&self, vtxo: &Vtxo) -> usize;
fn witness(
&self,
data: &Self::WitnessData,
control_block: &ControlBlock,
) -> Witness;
// Provided method
fn control_block(&self, vtxo: &Vtxo) -> ControlBlock { ... }
}Expand description
A trait describing a VTXO policy clause.
It can be used when creating the VTXO, specifying the script pubkey, and check the satisfaction weight when spending it.
Required Associated Types§
Sourcetype WitnessData
type WitnessData
The type of witness data required to sign the clause.
Required Methods§
Sourcefn witness_size(&self, vtxo: &Vtxo) -> usize
fn witness_size(&self, vtxo: &Vtxo) -> usize
Computes the total witness size in bytes for spending via this clause.
Sourcefn witness(
&self,
data: &Self::WitnessData,
control_block: &ControlBlock,
) -> Witness
fn witness( &self, data: &Self::WitnessData, control_block: &ControlBlock, ) -> Witness
Constructs the witness for the clause.
Provided Methods§
Sourcefn control_block(&self, vtxo: &Vtxo) -> ControlBlock
fn control_block(&self, vtxo: &Vtxo) -> ControlBlock
Construct the taproot control block for spending the VTXO using this clause
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.