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§
Sourcefn source_txid(&self) -> &[u8; 32]
fn source_txid(&self) -> &[u8; 32]
The transaction ID of the UTXO being spent (32 bytes, internal byte order).
Sourcefn source_output_index(&self) -> u32
fn source_output_index(&self) -> u32
The index of the output being spent in the source transaction.
Sourcefn source_satoshis(&self) -> Option<u64>
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).
Sourcefn source_locking_script(&self) -> Option<&LockingScript>
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.
Sourcefn unlocking_script(&self) -> &UnlockingScript
fn unlocking_script(&self) -> &UnlockingScript
The unlocking script for this input.