Struct elements_miniscript::descriptor::LegacyCSFSCov
source · 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: MiniscriptKey + FromStr,
Pk::Sha256: FromStr,
Pk::Hash256: FromStr,
Pk::Ripemd160: FromStr,
Pk::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ext: Extension,
impl<Pk, Ext> FromStr for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey + FromStr,
Pk::Sha256: FromStr,
Pk::Hash256: FromStr,
Pk::Ripemd160: FromStr,
Pk::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ext: Extension,
source§impl<Pk, Ext> FromTree for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey + FromStr,
Pk::Sha256: FromStr,
Pk::Hash256: FromStr,
Pk::Ripemd160: FromStr,
Pk::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
Ext: Extension,
impl<Pk, Ext> FromTree for LegacyCSFSCov<Pk, Ext>where
Pk: MiniscriptKey + FromStr,
Pk::Sha256: FromStr,
Pk::Hash256: FromStr,
Pk::Ripemd160: FromStr,
Pk::Hash160: FromStr,
<Pk as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Sha256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash256 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Ripemd160 as FromStr>::Err: ToString,
<<Pk as MiniscriptKey>::Hash160 as FromStr>::Err: ToString,
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§fn eq(&self, other: &LegacyCSFSCov<Pk, Ext>) -> bool
fn eq(&self, other: &LegacyCSFSCov<Pk, Ext>) -> bool
self
and other
values to be equal, and is used
by ==
.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§fn partial_cmp(&self, other: &LegacyCSFSCov<Pk, Ext>) -> Option<Ordering>
fn partial_cmp(&self, other: &LegacyCSFSCov<Pk, Ext>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Pk, Ext, ExtQ> TranslateExt<Ext, ExtQ> for LegacyCSFSCov<Pk, Ext>
impl<Pk, Ext, ExtQ> TranslateExt<Ext, ExtQ> for LegacyCSFSCov<Pk, Ext>
§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>
§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
.