Skip to content

Commit

Permalink
fix(chain)!: rm duplicate is_empty method in tx graph changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Feb 9, 2024
1 parent ae00e1e commit dbbd514
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions crates/chain/src/tx_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dbbd514

Please sign in to comment.