Skip to main content

TransactionInputContext

Trait TransactionInputContext 

Source
pub trait TransactionInputContext {
    // Required methods
    fn source_txid(&self) -> &[u8; 32];
    fn source_output_index(&self) -> u32;
    fn sequence(&self) -> u32;
    fn source_satoshis(&self) -> Option<u64>;
    fn source_locking_script(&self) -> Option<&LockingScript>;
    fn unlocking_script(&self) -> &UnlockingScript;
}
Expand description

Context from a transaction input needed for script validation.

This trait abstracts the transaction input data needed by the Script module to validate spends. The Transaction module will implement this trait.

Required Methods§

Source

fn source_txid(&self) -> &[u8; 32]

The transaction ID of the UTXO being spent (32 bytes, internal byte order).

Source

fn source_output_index(&self) -> u32

The index of the output being spent in the source transaction.

Source

fn sequence(&self) -> u32

The sequence number of this input.

Source

fn source_satoshis(&self) -> Option<u64>

The satoshi value of the UTXO being spent.

Returns None if the source transaction data is not available. This is required for sighash computation (BIP-143).

Source

fn source_locking_script(&self) -> Option<&LockingScript>

The locking script of the UTXO being spent.

Returns None if the source transaction data is not available.

Source

fn unlocking_script(&self) -> &UnlockingScript

The unlocking script for this input.

Implementors§