[−][src]Enum miniscript::descriptor::Descriptor
Script descriptor
Variants
Bare(Miniscript<P>)
A raw scriptpubkey (including pay-to-pubkey)
Pkh(P)
Pay-to-PubKey-Hash
Wpkh(P)
Pay-to-Witness-PubKey-Hash
ShWpkh(P)
Pay-to-Witness-PubKey-Hash inside P2SH
Sh(Miniscript<P>)
Pay-to-ScriptHash
Wsh(Miniscript<P>)
Pay-to-Witness-ScriptHash
ShWsh(Miniscript<P>)
P2SH-P2WSH
Methods
impl<P> Descriptor<P>
[src]
pub fn translate<F, Q, E>(&self, translatefn: F) -> Result<Descriptor<Q>, E> where
F: FnMut(&P) -> Result<Q, E>,
[src]
F: FnMut(&P) -> Result<Q, E>,
Convert a descriptor using abstract keys to one using specific keys
impl<P: Clone> Descriptor<P>
[src]
pub fn abstract_policy(&self) -> AbstractPolicy<P>
[src]
Abstract the script into an "abstract policy" which can be filtered and analyzed
impl<P: ToPublicKey> Descriptor<P>
[src]
pub fn address(&self, network: Network) -> Option<Address>
[src]
Computes the Bitcoin address of the descriptor, if one exists
pub fn script_pubkey(&self) -> Script
[src]
Computes the scriptpubkey of the descriptor
pub fn unsigned_script_sig(&self) -> Script
[src]
Computes the scriptSig that will be in place for an unsigned input spending an output with this descriptor. For pre-segwit descriptors, which use the scriptSig for signatures, this returns the empty script.
This is used in Segwit transactions to produce an unsigned transaction whose txid will not change during signing (since only the witness data will change).
pub fn witness_script(&self) -> Script
[src]
Computes the "witness script" of the descriptor, i.e. the underlying
script before any hashing is done. For Bare
, Pkh
and Wpkh
this
is the scriptPubkey; for ShWpkh
and Sh
this is the redeemScript;
for the others it is the witness script.
pub fn satisfy<F, H>(
&self,
txin: &mut TxIn,
sigfn: Option<F>,
hashfn: Option<H>,
age: u32
) -> Result<(), Error> where
F: FnMut(&P) -> Option<(Signature, SigHashType)>,
H: FnMut(Hash) -> Option<[u8; 32]>,
[src]
&self,
txin: &mut TxIn,
sigfn: Option<F>,
hashfn: Option<H>,
age: u32
) -> Result<(), Error> where
F: FnMut(&P) -> Option<(Signature, SigHashType)>,
H: FnMut(Hash) -> Option<[u8; 32]>,
Attempts to produce a satisfying witness or scriptSig, as the case may be,
for the descriptor, and add it to a TxIn
object in the appropriate place
pub fn max_satisfaction_weight(&self) -> usize
[src]
Computes an upper bound on the weight of a satisfying witness to the transaction. Assumes all signatures are 73 bytes, including push opcode and sighash suffix. Includes the weight of the VarInts encoding the scriptSig and witness stack length.
Trait Implementations
impl<P: Debug + FromStr> FromTree for Descriptor<P> where
<P as FromStr>::Err: ToString,
[src]
<P as FromStr>::Err: ToString,
fn from_tree(top: &Tree) -> Result<Descriptor<P>, Error>
[src]
Parse an expression tree into a descriptor
impl<P: Eq> Eq for Descriptor<P>
[src]
impl<P: Ord> Ord for Descriptor<P>
[src]
fn cmp(&self, other: &Descriptor<P>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<P: PartialEq> PartialEq<Descriptor<P>> for Descriptor<P>
[src]
fn eq(&self, other: &Descriptor<P>) -> bool
[src]
fn ne(&self, other: &Descriptor<P>) -> bool
[src]
impl<P: Clone> Clone for Descriptor<P>
[src]
fn clone(&self) -> Descriptor<P>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<P: PartialOrd> PartialOrd<Descriptor<P>> for Descriptor<P>
[src]
fn partial_cmp(&self, other: &Descriptor<P>) -> Option<Ordering>
[src]
fn lt(&self, other: &Descriptor<P>) -> bool
[src]
fn le(&self, other: &Descriptor<P>) -> bool
[src]
fn gt(&self, other: &Descriptor<P>) -> bool
[src]
fn ge(&self, other: &Descriptor<P>) -> bool
[src]
impl<P: Debug> Debug for Descriptor<P>
[src]
impl<P: Display> Display for Descriptor<P>
[src]
impl<P: Debug + FromStr> FromStr for Descriptor<P> where
<P as FromStr>::Err: ToString,
[src]
<P as FromStr>::Err: ToString,
Auto Trait Implementations
impl<P> Send for Descriptor<P> where
P: Send,
P: Send,
impl<P> Sync for Descriptor<P> where
P: Sync,
P: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,