From dbbd51424284a960a95c3801b02dc1973322725f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Sat, 10 Feb 2024 03:35:48 +0800 Subject: [PATCH] fix(chain)!: rm duplicate `is_empty` method in tx graph changeset --- crates/chain/src/tx_graph.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index cfa9d5f5..75a81d4a 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -67,7 +67,10 @@ //! //! // 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 Default for ChangeSet { } impl ChangeSet { - /// 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 { self.txs