Struct bitcoin_scripts::ScriptSet
source · pub struct ScriptSet {
pub pubkey_script: PubkeyScript,
pub sig_script: SigScript,
pub witness: Option<Witness>,
}Expand description
Scripting data for both transaction output and spending transaction input
parts that can be generated from some complete bitcoin Script
(LockScript) or public key using particular crate::ConvertInfo
Fields§
§pubkey_script: PubkeyScriptTransaction output scriptPubkey
sig_script: SigScriptTransaction input sigScript, without satisfaction data (signatures,
public keys etc)
witness: Option<Witness>Transaction input witness, without satisfaction data (signatures,
public keys etc)
Implementations§
source§impl ScriptSet
impl ScriptSet
sourcepub fn has_witness(&self) -> bool
pub fn has_witness(&self) -> bool
Detects whether the structure contains witness data
sourcepub fn is_witness_sh(&self) -> bool
pub fn is_witness_sh(&self) -> bool
Detects whether the structure is either P2SH-P2WPKH or P2SH-P2WSH
sourcepub fn transmutate(&mut self, use_witness: bool) -> bool
pub fn transmutate(&mut self, use_witness: bool) -> bool
Tries to convert witness-based script structure into pre-SegWit – and
vice verse. Returns true if the conversion is possible and was
successful, false if the conversion is impossible; in the later case
the self is not changed. The conversion is impossible in the following
cases:
- for P2SH-P2WPKH or P2SH-P2WPSH variants (can be detected with ScriptSet::is_witness_sh function)
- for bitcoin_scripts that are internally inconsistent
Trait Implementations§
source§impl Ord for ScriptSet
impl Ord for ScriptSet
source§impl PartialEq<ScriptSet> for ScriptSet
impl PartialEq<ScriptSet> for ScriptSet
source§impl PartialOrd<ScriptSet> for ScriptSet
impl PartialOrd<ScriptSet> for ScriptSet
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