Trait bitcoins::types::tx::BitcoinTransaction[][src]

pub trait BitcoinTransaction: Transaction<Error = TxError, TxError = TxError, TXID = TXID, TxOut = TxOut, TxIn = BitcoinTxIn, HashWriter = Hash256> {
    fn as_legacy(&self) -> &LegacyTx;
fn into_legacy(self) -> LegacyTx;
fn into_witness(self) -> WitnessTx;
fn witnesses(&self) -> &[Witness]; fn txout_from_outpoint(&self, outpoint: &BitcoinOutpoint) -> Option<&TxOut> { ... } }
Expand description

Functions common to Bitcoin transactions. This provides a small abstraction layer over the Legacy/SegWit tx divide by implementing a small common interface between them.

Required methods

Returns a reference to the tx as a legacy tx.

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types, but into_witness should be preferred, as it will never drop information.

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types.

Return a reference to a slice of witnesses. For legacy txins this will ALWAYS be length 0. For witness txns, this will ALWAYS be the same length as the input vector.

Provided methods

Get a reference to the output by

Implementors