pub struct SigHashCache<'a> { /* private fields */ }Expand description
Public signature-hash cache wrapper for bitcoin-rs script callers.
Implementations§
Source§impl<'a> SigHashCache<'a>
impl<'a> SigHashCache<'a>
Sourcepub fn legacy_signature_hash(
&self,
input_index: usize,
script_pubkey: &Script,
sighash_type: u32,
) -> Result<LegacySighash, InputsIndexError>
pub fn legacy_signature_hash( &self, input_index: usize, script_pubkey: &Script, sighash_type: u32, ) -> Result<LegacySighash, InputsIndexError>
Computes a legacy signature hash.
Sourcepub fn p2wpkh_signature_hash(
&mut self,
input_index: usize,
script_pubkey: &Script,
value: Amount,
sighash_type: EcdsaSighashType,
) -> Result<SegwitV0Sighash, P2wpkhError>
pub fn p2wpkh_signature_hash( &mut self, input_index: usize, script_pubkey: &Script, value: Amount, sighash_type: EcdsaSighashType, ) -> Result<SegwitV0Sighash, P2wpkhError>
Computes a BIP143 P2WPKH signature hash.
Sourcepub fn p2wsh_signature_hash(
&mut self,
input_index: usize,
witness_script: &Script,
value: Amount,
sighash_type: EcdsaSighashType,
) -> Result<SegwitV0Sighash, InputsIndexError>
pub fn p2wsh_signature_hash( &mut self, input_index: usize, witness_script: &Script, value: Amount, sighash_type: EcdsaSighashType, ) -> Result<SegwitV0Sighash, InputsIndexError>
Computes a BIP143 P2WSH signature hash.
Sourcepub fn taproot_key_spend_signature_hash<T: Borrow<TxOut>>(
&mut self,
input_index: usize,
prevouts: &Prevouts<'_, T>,
sighash_type: TapSighashType,
) -> Result<TapSighash, TaprootError>
pub fn taproot_key_spend_signature_hash<T: Borrow<TxOut>>( &mut self, input_index: usize, prevouts: &Prevouts<'_, T>, sighash_type: TapSighashType, ) -> Result<TapSighash, TaprootError>
Computes a BIP341 taproot key-path signature hash.
Sourcepub fn taproot_script_spend_signature_hash<S, T>(
&mut self,
input_index: usize,
prevouts: &Prevouts<'_, T>,
leaf_hash: S,
sighash_type: TapSighashType,
) -> Result<TapSighash, TaprootError>
pub fn taproot_script_spend_signature_hash<S, T>( &mut self, input_index: usize, prevouts: &Prevouts<'_, T>, leaf_hash: S, sighash_type: TapSighashType, ) -> Result<TapSighash, TaprootError>
Computes a BIP342 tapscript signature hash.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SigHashCache<'a>
impl<'a> RefUnwindSafe for SigHashCache<'a>
impl<'a> Send for SigHashCache<'a>
impl<'a> Sync for SigHashCache<'a>
impl<'a> Unpin for SigHashCache<'a>
impl<'a> UnsafeUnpin for SigHashCache<'a>
impl<'a> UnwindSafe for SigHashCache<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more