@@ -41,7 +41,7 @@ use crate::{
41
41
/// conflicted). It includes the transaction itself along with its position in the chain (confirmed
42
42
/// or unconfirmed).
43
43
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord ) ]
44
- pub struct CanonicalViewTx < A > {
44
+ pub struct CanonicalTx < A > {
45
45
/// The position of this transaction in the chain.
46
46
///
47
47
/// This indicates whether the transaction is confirmed (and at what height) or
@@ -228,11 +228,11 @@ impl<A: Anchor> CanonicalView<A> {
228
228
/// println!("Found tx {} at position {:?}", canonical_tx.txid, canonical_tx.pos);
229
229
/// }
230
230
/// ```
231
- pub fn tx ( & self , txid : Txid ) -> Option < CanonicalViewTx < A > > {
231
+ pub fn tx ( & self , txid : Txid ) -> Option < CanonicalTx < A > > {
232
232
self . txs
233
233
. get ( & txid)
234
234
. cloned ( )
235
- . map ( |( tx, pos) | CanonicalViewTx { pos, txid, tx } )
235
+ . map ( |( tx, pos) | CanonicalTx { pos, txid, tx } )
236
236
}
237
237
238
238
/// Get a single canonical transaction output.
@@ -302,12 +302,10 @@ impl<A: Anchor> CanonicalView<A> {
302
302
/// // Get the total number of canonical transactions
303
303
/// println!("Total canonical transactions: {}", view.txs().len());
304
304
/// ```
305
- pub fn txs (
306
- & self ,
307
- ) -> impl ExactSizeIterator < Item = CanonicalViewTx < A > > + DoubleEndedIterator + ' _ {
305
+ pub fn txs ( & self ) -> impl ExactSizeIterator < Item = CanonicalTx < A > > + DoubleEndedIterator + ' _ {
308
306
self . order . iter ( ) . map ( |& txid| {
309
307
let ( tx, pos) = self . txs [ & txid] . clone ( ) ;
310
- CanonicalViewTx { pos, txid, tx }
308
+ CanonicalTx { pos, txid, tx }
311
309
} )
312
310
}
313
311
0 commit comments