Struct sapio_miniscript::descriptor::Sh
source · pub struct Sh<Pk: MiniscriptKey> { /* private fields */ }
Expand description
A Legacy p2sh Descriptor
Implementations§
source§impl<Pk: MiniscriptKey> Sh<Pk>
impl<Pk: MiniscriptKey> Sh<Pk>
sourcepub fn into_inner(self) -> ShInner<Pk>
pub fn into_inner(self) -> ShInner<Pk>
Get the Inner
sourcepub fn new(ms: Miniscript<Pk, Legacy>) -> Result<Self, Error>
pub fn new(ms: Miniscript<Pk, Legacy>) -> Result<Self, Error>
Create a new p2sh descriptor with the raw miniscript
sourcepub fn new_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
pub fn new_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
Create a new p2sh sortedmulti descriptor with threshold k
and Vec of pks
.
sourcepub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Self, Error>
pub fn new_wsh(ms: Miniscript<Pk, Segwitv0>) -> Result<Self, Error>
Create a new p2sh wrapped wsh descriptor with the raw miniscript
sourcepub fn new_with_wsh(wsh: Wsh<Pk>) -> Self
pub fn new_with_wsh(wsh: Wsh<Pk>) -> Self
Create a new p2sh wrapper for the given wsh descriptor
sourcepub fn new_wsh_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
pub fn new_wsh_sortedmulti(k: usize, pks: Vec<Pk>) -> Result<Self, Error>
Create a new p2sh wrapped wsh sortedmulti descriptor from threshold
k
and Vec of pks
sourcepub fn new_with_wpkh(wpkh: Wpkh<Pk>) -> Self
pub fn new_with_wpkh(wpkh: Wpkh<Pk>) -> Self
Create a new p2sh wrapper for the given wpkh descriptor
source§impl<Pk: MiniscriptKey + ToPublicKey> Sh<Pk>
impl<Pk: MiniscriptKey + ToPublicKey> Sh<Pk>
sourcepub fn spk(&self) -> Script
pub fn spk(&self) -> Script
Obtain the corresponding script pubkey for this descriptor
Non failing verion of DescriptorTrait::script_pubkey
for this descriptor
sourcepub fn addr(&self, network: Network) -> Address
pub fn addr(&self, network: Network) -> Address
Obtain the corresponding script pubkey for this descriptor
Non failing verion of DescriptorTrait::address
for this descriptor
sourcepub fn inner_script(&self) -> Script
pub fn inner_script(&self) -> Script
Obtain the underlying miniscript for this descriptor
Non failing verion of DescriptorTrait::explicit_script
for this descriptor
sourcepub fn ecdsa_sighash_script_code(&self) -> Script
pub fn ecdsa_sighash_script_code(&self) -> Script
Obtain the pre bip-340 signature script code for this descriptor
Non failing verion of DescriptorTrait::script_code
for this descriptor
Trait Implementations§
source§impl<Pk: MiniscriptKey> Debug for Sh<Pk>
impl<Pk: MiniscriptKey> Debug for Sh<Pk>
source§impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> DescriptorTrait<Pk> for Sh<Pk>
source§fn sanity_check(&self) -> Result<(), Error>
fn sanity_check(&self) -> Result<(), Error>
source§fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
fn address(&self, network: Network) -> Result<Address, Error>where
Pk: ToPublicKey,
source§fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
fn script_pubkey(&self) -> Scriptwhere
Pk: ToPublicKey,
source§fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
fn unsigned_script_sig(&self) -> Scriptwhere
Pk: ToPublicKey,
source§fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn explicit_script(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
Bare
, Pkh
and Wpkh
this
is the scriptPubkey; for ShWpkh
and Sh
this is the redeemScript;
for the others it is the witness script.
For Tr
descriptors, this will error as there is no underlying scriptsource§fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
fn get_satisfaction<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
source§fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
fn get_satisfaction_mall<S>(
&self,
satisfier: S
) -> Result<(Vec<Vec<u8>>, Script), Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
source§fn max_satisfaction_weight(&self) -> Result<usize, Error>
fn max_satisfaction_weight(&self) -> Result<usize, Error>
source§fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
fn script_code(&self) -> Result<Script, Error>where
Pk: ToPublicKey,
scriptCode
of a transaction output. Read moresource§impl<Pk: MiniscriptKey> Display for Sh<Pk>
impl<Pk: MiniscriptKey> Display for Sh<Pk>
source§impl<Pk: MiniscriptKey> ForEachKey<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> ForEachKey<Pk> for Sh<Pk>
source§impl<Pk: MiniscriptKey> From<Sh<Pk>> for Descriptor<Pk>
impl<Pk: MiniscriptKey> From<Sh<Pk>> for Descriptor<Pk>
source§impl<Pk: MiniscriptKey> Liftable<Pk> for Sh<Pk>
impl<Pk: MiniscriptKey> Liftable<Pk> for Sh<Pk>
source§impl<Pk: Ord + MiniscriptKey> Ord for Sh<Pk>
impl<Pk: Ord + MiniscriptKey> Ord for Sh<Pk>
source§impl<Pk: PartialEq + MiniscriptKey> PartialEq for Sh<Pk>
impl<Pk: PartialEq + MiniscriptKey> PartialEq for Sh<Pk>
source§impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Sh<Pk>
impl<Pk: PartialOrd + MiniscriptKey> PartialOrd for Sh<Pk>
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 more