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: PubkeyScript
Transaction output scriptPubkey
sig_script: SigScript
Transaction input sigScript
, without satisfaction data (signatures,
public keys etc)
witness: Option<Witness>
Transaction input witness
, without satisfaction data (signatures,
public keys etc)
Implementations
sourceimpl 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 scripts that are internally inconsistent
Trait Implementations
sourceimpl Ord for ScriptSet
impl Ord for ScriptSet
sourceimpl PartialOrd<ScriptSet> for ScriptSet
impl PartialOrd<ScriptSet> for ScriptSet
sourcefn partial_cmp(&self, other: &ScriptSet) -> Option<Ordering>
fn partial_cmp(&self, other: &ScriptSet) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for ScriptSet
impl StructuralEq for ScriptSet
impl StructuralPartialEq for ScriptSet
Auto Trait Implementations
impl RefUnwindSafe for ScriptSet
impl Send for ScriptSet
impl Sync for ScriptSet
impl Unpin for ScriptSet
impl UnwindSafe for ScriptSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more