X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Ftransaction.rs;h=33b9c7244a37d1ad13adedda973c70a23c40f10a;hb=27079e04d7b542058e48cafaf5c2e7114b3b8e15;hp=ce43984ebd48b270f0f32da2266da2ac940e2a6b;hpb=126b514168ff8294f6ee7b9573797c6759512b9c;p=rust-lightning diff --git a/lightning/src/chain/transaction.rs b/lightning/src/chain/transaction.rs index ce43984e..33b9c724 100644 --- a/lightning/src/chain/transaction.rs +++ b/lightning/src/chain/transaction.rs @@ -1,6 +1,6 @@ //! Contains simple structs describing parts of transactions on the chain. -use bitcoin_hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hash_types::Txid; use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint; /// A reference to a transaction output. @@ -10,14 +10,14 @@ use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint; #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] pub struct OutPoint { /// The referenced transaction's txid. - pub txid: Sha256dHash, + pub txid: Txid, /// The index of the referenced output in its transaction's vout. pub index: u16, } impl OutPoint { /// Creates a new `OutPoint` from the txid and the index. - pub fn new(txid: Sha256dHash, index: u16) -> OutPoint { + pub fn new(txid: Txid, index: u16) -> OutPoint { OutPoint { txid, index } } @@ -39,6 +39,8 @@ impl OutPoint { } } +impl_writeable!(OutPoint, 0, { txid, index }); + #[cfg(test)] mod tests { use chain::transaction::OutPoint;