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