pub struct LegacyCSFSCov<Pk: MiniscriptKey, Ext: Extension> { /* private fields */ }
Expand description
The covenant descriptor
Implementations§
Source§impl<Pk: MiniscriptKey, Ext: Extension> LegacyCSFSCov<Pk, Ext>
impl<Pk: MiniscriptKey, Ext: Extension> LegacyCSFSCov<Pk, Ext>
Sourcepub fn to_ms(&self) -> &Miniscript<Pk, Segwitv0, Ext>
pub fn to_ms(&self) -> &Miniscript<Pk, Segwitv0, Ext>
Get a reference to Miniscript inside covenant
Sourcepub fn into_ms(self) -> Miniscript<Pk, Segwitv0, Ext>
pub fn into_ms(self) -> Miniscript<Pk, Segwitv0, Ext>
Consume self and return inner miniscript
Sourcepub fn new(pk: Pk, ms: Miniscript<Pk, Segwitv0, Ext>) -> Result<Self, Error>
pub fn new(pk: Pk, ms: Miniscript<Pk, Segwitv0, Ext>) -> Result<Self, Error>
Create a new Self from components
Sourcepub fn encode(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn encode(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
Encode
Sourcepub fn satisfy<S: Satisfier<Pk>>(
&self,
s: S,
allow_mall: bool,
) -> Result<Vec<Vec<u8>>, Error>where
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn satisfy<S: Satisfier<Pk>>(
&self,
s: S,
allow_mall: bool,
) -> Result<Vec<Vec<u8>>, Error>where
Pk: ToPublicKey,
Ext: ParseableExt,
Create a satisfaction for the Covenant Descriptor
Sourcepub fn cov_script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
pub fn cov_script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
Script code for signing with covenant publickey. Use this script_code for sighash method when signing with the covenant pk.
Source§impl<Ext: ParseableExt> LegacyCSFSCov<PublicKey, Ext>
impl<Ext: ParseableExt> LegacyCSFSCov<PublicKey, Ext>
Sourcepub fn parse_insane(script: &Script) -> Result<Self, Error>
pub fn parse_insane(script: &Script) -> Result<Self, Error>
Parse a descriptor from script. While parsing other descriptors, we only parse the inner miniscript with ScriptContext. But Covenant descriptors only applicable under Wsh context to avoid implementation complexity.
Sourcepub fn parse(script: &Script) -> Result<Self, Error>
pub fn parse(script: &Script) -> Result<Self, Error>
Parse a descriptor with additional local sanity checks.
See Miniscript::sanity_check
for all the checks. Use
Miniscript::parse_insane
to allow parsing insane scripts
Source§impl<Pk, Ext> LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
impl<Pk, Ext> LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
Sourcepub fn sanity_check(&self) -> Result<(), Error>
pub fn sanity_check(&self) -> Result<(), Error>
Sanity checks for this covenant descriptor
Sourcepub fn address(
&self,
blinder: Option<PublicKey>,
params: &'static AddressParams,
) -> Addresswhere
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn address(
&self,
blinder: Option<PublicKey>,
params: &'static AddressParams,
) -> Addresswhere
Pk: ToPublicKey,
Ext: ParseableExt,
Obtains the blinded address for this descriptor.
Sourcepub fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
Obtains the script pubkey for this descriptor.
Sourcepub fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
pub fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
Computes the scriptSig that will be in place for an unsigned input spending an output with this descriptor.
Sourcepub fn inner_script(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn inner_script(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
Computes the the underlying script before any hashing is done.
Sourcepub fn get_satisfaction<S>(
&self,
satisfier: S,
) -> Result<(Vec<Vec<u8>>, Script), Error>
pub fn get_satisfaction<S>( &self, satisfier: S, ) -> Result<(Vec<Vec<u8>>, Script), Error>
Returns satisfying non-malleable witness and scriptSig to spend an output controlled by the given descriptor if it possible to construct one using the satisfier S.
Sourcepub fn max_satisfaction_weight(&self) -> Result<usize, Error>
pub fn max_satisfaction_weight(&self) -> Result<usize, Error>
Computes an upper bound on the weight of a satisfying witness to the transaction.
Sourcepub fn ecdsa_sighash_script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
pub fn ecdsa_sighash_script_code(&self) -> Scriptwhere
Pk: ToPublicKey,
Ext: ParseableExt,
This returns the entire explicit script as the script code.
You will need this script code when singing with pks that
inside Miniscript. Use the Self::cov_script_code
method to
get the script code for signing with covenant pk
Trait Implementations§
Source§impl<Pk: Clone + MiniscriptKey, Ext: Clone + Extension> Clone for LegacyCSFSCov<Pk, Ext>
impl<Pk: Clone + MiniscriptKey, Ext: Clone + Extension> Clone for LegacyCSFSCov<Pk, Ext>
Source§fn clone(&self) -> LegacyCSFSCov<Pk, Ext>
fn clone(&self) -> LegacyCSFSCov<Pk, Ext>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<Pk, Ext> Debug for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
impl<Pk, Ext> Debug for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
Source§impl<Pk, Ext> Display for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
impl<Pk, Ext> Display for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey,
Ext: Extension,
Source§impl<Pk: MiniscriptKey, Ext: Extension> ForEachKey<Pk> for LegacyCSFSCov<Pk, Ext>
impl<Pk: MiniscriptKey, Ext: Extension> ForEachKey<Pk> for LegacyCSFSCov<Pk, Ext>
Source§impl<Pk: MiniscriptKey, Arg: ExtParam> From<LegacyCSFSCov<Pk, CovenantExt<Arg>>> for Descriptor<Pk, CovenantExt<Arg>>
impl<Pk: MiniscriptKey, Arg: ExtParam> From<LegacyCSFSCov<Pk, CovenantExt<Arg>>> for Descriptor<Pk, CovenantExt<Arg>>
Source§fn from(inner: LegacyCSFSCov<Pk, CovenantExt<Arg>>) -> Self
fn from(inner: LegacyCSFSCov<Pk, CovenantExt<Arg>>) -> Self
Source§impl<Pk, Ext> FromStr for LegacyCSFSCov<Pk, Ext>where
Pk: FromStrKey,
Ext: Extension,
impl<Pk, Ext> FromStr for LegacyCSFSCov<Pk, Ext>where
Pk: FromStrKey,
Ext: Extension,
Source§impl<Pk, Ext> FromTree for LegacyCSFSCov<Pk, Ext>where
Pk: FromStrKey,
Ext: Extension,
impl<Pk, Ext> FromTree for LegacyCSFSCov<Pk, Ext>where
Pk: FromStrKey,
Ext: Extension,
Source§impl<Pk: Ord + MiniscriptKey, Ext: Ord + Extension> Ord for LegacyCSFSCov<Pk, Ext>
impl<Pk: Ord + MiniscriptKey, Ext: Ord + Extension> Ord for LegacyCSFSCov<Pk, Ext>
Source§fn cmp(&self, other: &LegacyCSFSCov<Pk, Ext>) -> Ordering
fn cmp(&self, other: &LegacyCSFSCov<Pk, Ext>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<Pk: PartialEq + MiniscriptKey, Ext: PartialEq + Extension> PartialEq for LegacyCSFSCov<Pk, Ext>
impl<Pk: PartialEq + MiniscriptKey, Ext: PartialEq + Extension> PartialEq for LegacyCSFSCov<Pk, Ext>
Source§impl<Pk: PartialOrd + MiniscriptKey, Ext: PartialOrd + Extension> PartialOrd for LegacyCSFSCov<Pk, Ext>
impl<Pk: PartialOrd + MiniscriptKey, Ext: PartialOrd + Extension> PartialOrd for LegacyCSFSCov<Pk, Ext>
Source§impl<Pk, Ext, ExtQ> TranslateExt<Ext, ExtQ> for LegacyCSFSCov<Pk, Ext>
impl<Pk, Ext, ExtQ> TranslateExt<Ext, ExtQ> for LegacyCSFSCov<Pk, Ext>
Source§type Output = LegacyCSFSCov<Pk, ExtQ>
type Output = LegacyCSFSCov<Pk, ExtQ>
Source§fn translate_ext<T, E>(&self, translator: &mut T) -> Result<Self::Output, E>where
T: ExtTranslator<Ext, ExtQ, E>,
fn translate_ext<T, E>(&self, translator: &mut T) -> Result<Self::Output, E>where
T: ExtTranslator<Ext, ExtQ, E>,
Translator
.Source§impl<P, Q, Ext> TranslatePk<P, Q> for LegacyCSFSCov<P, Ext>
impl<P, Q, Ext> TranslatePk<P, Q> for LegacyCSFSCov<P, Ext>
Source§type Output = LegacyCSFSCov<Q, Ext>
type Output = LegacyCSFSCov<Q, Ext>
Self<Q>
.Source§fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, E>where
T: Translator<P, Q, E>,
fn translate_pk<T, E>(&self, t: &mut T) -> Result<Self::Output, E>where
T: Translator<P, Q, E>,
Translator
.