diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 4c2990351..0ceea3e30 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -1216,6 +1216,13 @@ impl TxGraph { 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) -> Self { + let mut graph = Self::default(); + graph.apply_changeset(changeset); + graph + } } /// The [`ChangeSet`] represents changes to a [`TxGraph`].