@@ -41,7 +41,7 @@ use crate::{
4141/// conflicted). It includes the transaction itself along with its position in the chain (confirmed
4242/// or unconfirmed).
4343#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord ) ]
44- pub struct CanonicalViewTx < A > {
44+ pub struct CanonicalTx < A > {
4545 /// The position of this transaction in the chain.
4646 ///
4747 /// This indicates whether the transaction is confirmed (and at what height) or
@@ -228,11 +228,11 @@ impl<A: Anchor> CanonicalView<A> {
228228 /// println!("Found tx {} at position {:?}", canonical_tx.txid, canonical_tx.pos);
229229 /// }
230230 /// ```
231- pub fn tx ( & self , txid : Txid ) -> Option < CanonicalViewTx < A > > {
231+ pub fn tx ( & self , txid : Txid ) -> Option < CanonicalTx < A > > {
232232 self . txs
233233 . get ( & txid)
234234 . cloned ( )
235- . map ( |( tx, pos) | CanonicalViewTx { pos, txid, tx } )
235+ . map ( |( tx, pos) | CanonicalTx { pos, txid, tx } )
236236 }
237237
238238 /// Get a single canonical transaction output.
@@ -302,12 +302,10 @@ impl<A: Anchor> CanonicalView<A> {
302302 /// // Get the total number of canonical transactions
303303 /// println!("Total canonical transactions: {}", view.txs().len());
304304 /// ```
305- pub fn txs (
306- & self ,
307- ) -> impl ExactSizeIterator < Item = CanonicalViewTx < A > > + DoubleEndedIterator + ' _ {
305+ pub fn txs ( & self ) -> impl ExactSizeIterator < Item = CanonicalTx < A > > + DoubleEndedIterator + ' _ {
308306 self . order . iter ( ) . map ( |& txid| {
309307 let ( tx, pos) = self . txs [ & txid] . clone ( ) ;
310- CanonicalViewTx { pos, txid, tx }
308+ CanonicalTx { pos, txid, tx }
311309 } )
312310 }
313311
0 commit comments