Struct miniscript::descriptor::Bare
source · pub struct Bare<Pk: MiniscriptKey> { /* private fields */ }
Expand description
Create a Bare Descriptor. That is descriptor that is not wrapped in sh or wsh. This covers the Pk descriptor
Implementations
sourceimpl<Pk: MiniscriptKey> Bare<Pk>
impl<Pk: MiniscriptKey> Bare<Pk>
sourcepub fn into_inner(self) -> Miniscript<Pk, BareCtx>
pub fn into_inner(self) -> Miniscript<Pk, BareCtx>
get the inner
sourcepub fn as_inner(&self) -> &Miniscript<Pk, BareCtx>
pub fn as_inner(&self) -> &Miniscript<Pk, BareCtx>
get the inner
sourcepub fn sanity_check(&self) -> Result<(), Error>
pub fn sanity_check(&self) -> Result<(), Error>
Checks whether the descriptor is safe.
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.
Assumes all ec-signatures are 73 bytes, including push opcode and sighash suffix. Includes the weight of the VarInts encoding the scriptSig and witness stack length.
Errors
When the descriptor is impossible to safisfy (ex: sh(OP_FALSE)).
sourceimpl<Pk: MiniscriptKey + ToPublicKey> Bare<Pk>
impl<Pk: MiniscriptKey + ToPublicKey> Bare<Pk>
sourcepub fn script_pubkey(&self) -> Script
pub fn script_pubkey(&self) -> Script
Obtains the corresponding script pubkey for this descriptor.
sourcepub fn inner_script(&self) -> Script
pub fn inner_script(&self) -> Script
Obtains the underlying miniscript for this descriptor.
sourcepub fn ecdsa_sighash_script_code(&self) -> Script
pub fn ecdsa_sighash_script_code(&self) -> Script
Obtains the pre bip-340 signature script code for this descriptor.
sourcepub fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
S: Satisfier<Pk>,
pub fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
S: Satisfier<Pk>,
Returns satisfying non-malleable witness and scriptSig with minimum
weight to spend an output controlled by the given descriptor if it is
possible to construct one using the satisfier
.
sourcepub fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
S: Satisfier<Pk>,
pub fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
S: Satisfier<Pk>,
Returns satisfying, possibly malleable, witness and scriptSig with
minimum weight to spend an output controlled by the given descriptor if
it is possible to construct one using the satisfier
.
Trait Implementations
sourceimpl<Pk: Clone + MiniscriptKey> Clone for Bare<Pk>
impl<Pk: Clone + MiniscriptKey> Clone for Bare<Pk>
sourceimpl<Pk: MiniscriptKey> Debug for Bare<Pk>
impl<Pk: MiniscriptKey> Debug for Bare<Pk>
sourceimpl<Pk: MiniscriptKey> Display for Bare<Pk>
impl<Pk: MiniscriptKey> Display for Bare<Pk>
sourceimpl<Pk: MiniscriptKey> ForEachKey<Pk> for Bare<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Bare<Pk>
sourceimpl<Pk: MiniscriptKey> From<Bare<Pk>> for Descriptor<Pk>
impl<Pk: MiniscriptKey> From<Bare<Pk>> for Descriptor<Pk>
sourceimpl<Pk> FromStr for Bare<Pk>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,
impl<Pk> FromStr for Bare<Pk>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,
sourceimpl<Pk> FromTree for Bare<Pk>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,
impl<Pk> FromTree for Bare<Pk>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,
sourceimpl<Pk: Hash + MiniscriptKey> Hash for Bare<Pk>
impl<Pk: Hash + MiniscriptKey> Hash for Bare<Pk>
sourceimpl<Pk: MiniscriptKey> Liftable<Pk> for Bare<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Bare<Pk>
sourceimpl<Pk: Ord + MiniscriptKey> Ord for Bare<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Bare<Pk>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl<Pk: PartialEq + MiniscriptKey> PartialEq<Bare<Pk>> for Bare<Pk>
impl<Pk: PartialEq + MiniscriptKey> PartialEq<Bare<Pk>> for Bare<Pk>
sourceimpl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Bare<Pk>> for Bare<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd<Bare<Pk>> for Bare<Pk>
sourcefn partial_cmp(&self, other: &Bare<Pk>) -> Option<Ordering>
fn partial_cmp(&self, other: &Bare<Pk>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<P, Q> TranslatePk<P, Q> for Bare<P>where
P: MiniscriptKey,
Q: MiniscriptKey,
impl<P, Q> TranslatePk<P, Q> for Bare<P>where
P: MiniscriptKey,
Q: MiniscriptKey,
sourcefn 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
. Read more