* Added a `from_changeset()` function to `TxGraph` implementation
* This function initializes a new `TxGraph` and applies the given `ChangeSet`
* The method allows constructing a `TxGraph` directly from a `ChangeSet`,
simplifying graph creation.
self.try_list_expected_spk_txids(chain, chain_tip, indexer, spk_index_range)
.map(|r| r.expect("infallible"))
}
+
+ /// Construct a `TxGraph` from a `changeset`.
+ pub fn from_changeset(changeset: ChangeSet<A>) -> Self {
+ let mut graph = Self::default();
+ graph.apply_changeset(changeset);
+ graph
+ }
}
/// The [`ChangeSet`] represents changes to a [`TxGraph`].