pub struct PsbtSighashType { /* private fields */ }Expand description
A Signature hash type for the corresponding input.
As of taproot upgrade, the signature hash type can be either EcdsaSighashType or
TapSighashType but it is not possible to know directly which signature hash type the user is
dealing with. Therefore, the user is responsible for converting to/from PsbtSighashType
from/to the desired signature hash type they need.
Implementations§
Source§impl PsbtSighashType
impl PsbtSighashType
Sourcepub fn ecdsa_hash_ty(
self,
) -> Result<EcdsaSighashType, NonStandardSighashTypeError>
pub fn ecdsa_hash_ty( self, ) -> Result<EcdsaSighashType, NonStandardSighashTypeError>
Returns the EcdsaSighashType if the PsbtSighashType can be
converted to one.
Sourcepub fn taproot_hash_ty(self) -> Result<TapSighashType, InvalidSighashTypeError>
pub fn taproot_hash_ty(self) -> Result<TapSighashType, InvalidSighashTypeError>
Returns the TapSighashType if the PsbtSighashType can be
converted to one.
Sourcepub fn from_u32(n: u32) -> PsbtSighashType
pub fn from_u32(n: u32) -> PsbtSighashType
Creates a PsbtSighashType from a raw u32.
Allows construction of a non-standard or non-valid sighash flag
(EcdsaSighashType, TapSighashType respectively).
Sourcepub fn to_u32(self) -> u32
pub fn to_u32(self) -> u32
Converts PsbtSighashType to a raw u32 sighash flag.
No guarantees are made as to the standardness or validity of the returned value.
Trait Implementations§
Source§impl Clone for PsbtSighashType
impl Clone for PsbtSighashType
Source§fn clone(&self) -> PsbtSighashType
fn clone(&self) -> PsbtSighashType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PsbtSighashType
impl Debug for PsbtSighashType
Source§impl<'de> Deserialize<'de> for PsbtSighashType
impl<'de> Deserialize<'de> for PsbtSighashType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PsbtSighashType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PsbtSighashType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for PsbtSighashType
impl Display for PsbtSighashType
Source§impl From<EcdsaSighashType> for PsbtSighashType
impl From<EcdsaSighashType> for PsbtSighashType
Source§fn from(ecdsa_hash_ty: EcdsaSighashType) -> PsbtSighashType
fn from(ecdsa_hash_ty: EcdsaSighashType) -> PsbtSighashType
Source§impl From<TapSighashType> for PsbtSighashType
impl From<TapSighashType> for PsbtSighashType
Source§fn from(taproot_hash_ty: TapSighashType) -> PsbtSighashType
fn from(taproot_hash_ty: TapSighashType) -> PsbtSighashType
Source§impl FromStr for PsbtSighashType
impl FromStr for PsbtSighashType
Source§type Err = SighashTypeParseError
type Err = SighashTypeParseError
Source§fn from_str(
s: &str,
) -> Result<PsbtSighashType, <PsbtSighashType as FromStr>::Err>
fn from_str( s: &str, ) -> Result<PsbtSighashType, <PsbtSighashType as FromStr>::Err>
s to return a value of this type. Read more