@@ -22,7 +22,7 @@ use alloc::{
2222pub use bdk_chain:: keychain:: Balance ;
2323use bdk_chain:: {
2424 indexed_tx_graph,
25- keychain:: { self , KeychainTxOutIndex } ,
25+ keychain:: KeychainTxOutIndex ,
2626 local_chain:: {
2727 self , ApplyHeaderError , CannotConnectError , CheckPoint , CheckPointIter , LocalChain ,
2828 } ,
@@ -134,72 +134,7 @@ impl From<SyncResult> for Update {
134134}
135135
136136/// The changes made to a wallet by applying an [`Update`].
137- #[ derive( Debug , Clone , PartialEq , serde:: Serialize , serde:: Deserialize , Default ) ]
138- pub struct ChangeSet {
139- /// Changes to the [`LocalChain`].
140- ///
141- /// [`LocalChain`]: local_chain::LocalChain
142- pub chain : local_chain:: ChangeSet ,
143-
144- /// Changes to [`IndexedTxGraph`].
145- ///
146- /// [`IndexedTxGraph`]: bdk_chain::indexed_tx_graph::IndexedTxGraph
147- pub indexed_tx_graph : indexed_tx_graph:: ChangeSet <
148- ConfirmationTimeHeightAnchor ,
149- keychain:: ChangeSet < KeychainKind > ,
150- > ,
151-
152- /// Stores the network type of the wallet.
153- pub network : Option < Network > ,
154- }
155-
156- impl Append for ChangeSet {
157- fn append ( & mut self , other : Self ) {
158- Append :: append ( & mut self . chain , other. chain ) ;
159- Append :: append ( & mut self . indexed_tx_graph , other. indexed_tx_graph ) ;
160- if other. network . is_some ( ) {
161- debug_assert ! (
162- self . network. is_none( ) || self . network == other. network,
163- "network type must be consistent"
164- ) ;
165- self . network = other. network ;
166- }
167- }
168-
169- fn is_empty ( & self ) -> bool {
170- self . chain . is_empty ( ) && self . indexed_tx_graph . is_empty ( )
171- }
172- }
173-
174- impl From < local_chain:: ChangeSet > for ChangeSet {
175- fn from ( chain : local_chain:: ChangeSet ) -> Self {
176- Self {
177- chain,
178- ..Default :: default ( )
179- }
180- }
181- }
182-
183- impl
184- From <
185- indexed_tx_graph:: ChangeSet <
186- ConfirmationTimeHeightAnchor ,
187- keychain:: ChangeSet < KeychainKind > ,
188- > ,
189- > for ChangeSet
190- {
191- fn from (
192- indexed_tx_graph : indexed_tx_graph:: ChangeSet <
193- ConfirmationTimeHeightAnchor ,
194- keychain:: ChangeSet < KeychainKind > ,
195- > ,
196- ) -> Self {
197- Self {
198- indexed_tx_graph,
199- ..Default :: default ( )
200- }
201- }
202- }
137+ pub type ChangeSet = bdk_persist:: CombinedChangeSet < KeychainKind , ConfirmationTimeHeightAnchor > ;
203138
204139/// A derived address and the index it was found at.
205140/// For convenience this automatically derefs to `Address`
0 commit comments