]> Untitled Git - bdk/commitdiff
fix(chain)!: rm duplicate `is_empty` method in tx graph changeset
author志宇 <hello@evanlinjin.me>
Fri, 9 Feb 2024 19:35:48 +0000 (03:35 +0800)
committer志宇 <hello@evanlinjin.me>
Fri, 9 Feb 2024 19:35:48 +0000 (03:35 +0800)
crates/chain/src/tx_graph.rs

index cfa9d5f5c745e0a4ec91af230f08f51062200ea5..75a81d4ac88a655015da8967b5dbcb99945ee890 100644 (file)
 //!
 //! // if we apply it again, the resulting changeset will be empty
 //! let changeset = graph.apply_update(update);
-//! assert!(changeset.is_empty());
+//! assert!({
+//!     use bdk_chain::Append;
+//!     changeset.is_empty()
+//! });
 //! ```
 //! [`try_get_chain_position`]: TxGraph::try_get_chain_position
 //! [`insert_txout`]: TxGraph::insert_txout
@@ -1212,14 +1215,6 @@ impl<A> Default for ChangeSet<A> {
 }
 
 impl<A> ChangeSet<A> {
-    /// Returns true if the [`ChangeSet`] is empty (no transactions or txouts).
-    pub fn is_empty(&self) -> bool {
-        self.txs.is_empty()
-            && self.txouts.is_empty()
-            && self.anchors.is_empty()
-            && self.last_seen.is_empty()
-    }
-
     /// Iterates over all outpoints contained within [`ChangeSet`].
     pub fn txouts(&self) -> impl Iterator<Item = (OutPoint, &TxOut)> {
         self.txs