Enum groestlcoin::blockdata::transaction::SigHashType
source · [−]pub enum SigHashType {
All,
None,
Single,
AllPlusAnyoneCanPay,
NonePlusAnyoneCanPay,
SinglePlusAnyoneCanPay,
}
Expand description
Hashtype of an input’s signature, encoded in the last byte of the signature Fixed values so they can be casted as integer types for encoding
Variants
All
0x1: Sign all outputs
None
0x2: Sign no outputs — anyone can choose the destination
Single
0x3: Sign the output whose index matches this input’s index. If none exists,
sign the hash 0000000000000000000000000000000000000000000000000000000000000001
.
(This rule is probably an unintentional C++ism, but it’s consensus so we have
to follow it.)
AllPlusAnyoneCanPay
0x81: Sign all outputs but only this input
NonePlusAnyoneCanPay
0x82: Sign no outputs and only this input
SinglePlusAnyoneCanPay
0x83: Sign one output and only this input (see Single
for what “one output” means)
Implementations
sourceimpl SigHashType
impl SigHashType
sourcepub fn from_u32(n: u32) -> SigHashType
👎 Deprecated since 0.26.1: please use from_u32_consensus
or from_u32_standard
instead
pub fn from_u32(n: u32) -> SigHashType
please use from_u32_consensus
or from_u32_standard
instead
Reads a 4-byte uint32 as a sighash type.
sourcepub fn from_u32_consensus(n: u32) -> SigHashType
pub fn from_u32_consensus(n: u32) -> SigHashType
Reads a 4-byte uint32 as a sighash type.
Note: this replicates consensus behaviour, for current standardness rules correctness you probably want Self::from_u32_standard.
sourcepub fn from_u32_standard(n: u32) -> Result<SigHashType, NonStandardSigHashType>
pub fn from_u32_standard(n: u32) -> Result<SigHashType, NonStandardSigHashType>
Read a 4-byte uint32 as a standard sighash type, returning an error if the type is non standard.
Trait Implementations
sourceimpl Clone for SigHashType
impl Clone for SigHashType
sourcefn clone(&self) -> SigHashType
fn clone(&self) -> SigHashType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SigHashType
impl Debug for SigHashType
sourceimpl Deserialize for SigHashType
impl Deserialize for SigHashType
sourceimpl Display for SigHashType
impl Display for SigHashType
sourceimpl From<SigHashType> for u32
impl From<SigHashType> for u32
sourcefn from(t: SigHashType) -> u32
fn from(t: SigHashType) -> u32
Performs the conversion.
sourceimpl FromStr for SigHashType
impl FromStr for SigHashType
sourceimpl PartialEq<SigHashType> for SigHashType
impl PartialEq<SigHashType> for SigHashType
sourceimpl Serialize for SigHashType
impl Serialize for SigHashType
impl Copy for SigHashType
impl Eq for SigHashType
impl StructuralEq for SigHashType
impl StructuralPartialEq for SigHashType
Auto Trait Implementations
impl RefUnwindSafe for SigHashType
impl Send for SigHashType
impl Sync for SigHashType
impl Unpin for SigHashType
impl UnwindSafe for SigHashType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more