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
fn into_legacy(self) -> LegacyTx
fn into_legacy(self) -> LegacyTx
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.
fn into_witness(self) -> WitnessTx
fn into_witness(self) -> WitnessTx
Consume the tx and convert it to a legacy tx. Useful for when you have
dyn BitcoinTransaction
or impl BitcoinTransaction
types.
Provided methods
fn txout_from_outpoint(&self, outpoint: &BitcoinOutpoint) -> Option<&TxOut>
fn txout_from_outpoint(&self, outpoint: &BitcoinOutpoint) -> Option<&TxOut>
Get a reference to the output by