Struct clarity_repl::clarity::util::bitcoin::blockdata::transaction::Transaction [−][src]
A Bitcoin transaction, which describes an authenticated movement of coins
Fields
version: u32
The protocol version, should always be 1.
lock_time: u32
Block number before which this transaction is valid, or 0 for valid immediately.
input: Vec<TxIn>
List of inputs
output: Vec<TxOut>
List of outputs
Implementations
impl Transaction
[src]
pub fn ntxid(&self) -> Sha256dHash
[src]
Computes a “normalized TXID” which does not include any signatures. This gives a way to identify a transaction that is ``the same’’ as another in the sense of having same inputs and outputs.
pub fn txid(&self) -> Sha256dHash
[src]
Computes the txid. For non-segwit transactions this will be identical
to the output of BitcoinHash::bitcoin_hash()
, but for segwit transactions,
this will give the correct txid (not including witnesses) while bitcoin_hash
will also hash witnesses.
pub fn signature_hash(
&self,
input_index: usize,
script_pubkey: &Script,
sighash_u32: u32
) -> Sha256dHash
[src]
&self,
input_index: usize,
script_pubkey: &Script,
sighash_u32: u32
) -> Sha256dHash
Computes a signature hash for a given input index with a given sighash flag. To actually produce a scriptSig, this hash needs to be run through an ECDSA signer, the SigHashType appended to the resulting sig, and a script written around this, but this is the general (and hard) part.
Warning This does NOT attempt to support OP_CODESEPARATOR. In general
this would require evaluating script_pubkey
to determine which separators
get evaluated and which don’t, which we don’t have the information to
determine.
Panics
Panics if input_index
is greater than or equal to self.input.len()
pub fn get_weight(&self) -> u64
[src]
Gets the “weight” of this transaction, as defined by BIP141. For transactions with an empty witness, this is simply the consensus-serialized size times 4. For transactions with a witness, this is the non-witness consensus-serialized size multiplied by 3 plus the with-witness consensus-serialized size.
pub fn is_coin_base(&self) -> bool
[src]
Is this a coin base transaction?
Trait Implementations
impl BitcoinHash for Transaction
[src]
fn bitcoin_hash(&self) -> Sha256dHash
[src]
impl Clone for Transaction
[src]
fn clone(&self) -> Transaction
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<D: SimpleDecoder> ConsensusDecodable<D> for Transaction
[src]
fn consensus_decode(d: &mut D) -> Result<Transaction, Error>
[src]
impl<S: SimpleEncoder> ConsensusEncodable<S> for Transaction
[src]
impl Debug for Transaction
[src]
impl Eq for Transaction
[src]
impl Hash for Transaction
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Transaction> for Transaction
[src]
fn eq(&self, other: &Transaction) -> bool
[src]
fn ne(&self, other: &Transaction) -> bool
[src]
impl StructuralEq for Transaction
[src]
impl StructuralPartialEq for Transaction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,