@@ -21,12 +21,12 @@ use alloc::{
2121} ;
2222pub use bdk_chain:: keychain:: Balance ;
2323use bdk_chain:: {
24- indexed_tx_graph:: { IndexedAdditions , IndexedTxGraph } ,
24+ indexed_tx_graph:: IndexedAdditions ,
2525 keychain:: { KeychainTxOutIndex , LocalChangeSet , LocalUpdate } ,
2626 local_chain:: { self , LocalChain , UpdateNotConnectedError } ,
2727 tx_graph:: { CanonicalTx , TxGraph } ,
28- Append , BlockId , ChainPosition , ConfirmationTime , ConfirmationTimeAnchor , FullTxOut , Persist ,
29- PersistBackend ,
28+ Append , BlockId , ChainPosition , ConfirmationTime , ConfirmationTimeAnchor , FullTxOut ,
29+ IndexedTxGraph , Persist , PersistBackend ,
3030} ;
3131use bitcoin:: consensus:: encode:: serialize;
3232use bitcoin:: secp256k1:: Secp256k1 ;
@@ -88,15 +88,15 @@ pub struct Wallet<D = ()> {
8888 change_signers : Arc < SignersContainer > ,
8989 chain : LocalChain ,
9090 indexed_graph : IndexedTxGraph < ConfirmationTimeAnchor , KeychainTxOutIndex < KeychainKind > > ,
91- persist : Persist < D , ChangeSet > , // [TODO] Use a different `ChangeSet`
91+ persist : Persist < D , ChangeSet > ,
9292 network : Network ,
9393 secp : SecpCtx ,
9494}
9595
9696/// The update to a [`Wallet`] used in [`Wallet::apply_update`]. This is usually returned from blockchain data sources.
9797pub type Update = LocalUpdate < KeychainKind , ConfirmationTimeAnchor > ;
9898
99- // /// The changeset produced internally by applying an update .
99+ /// The changeset produced internally by [`Wallet`] when mutated .
100100pub type ChangeSet = LocalChangeSet < KeychainKind , ConfirmationTimeAnchor > ;
101101
102102/// The address index selection strategy to use to derived an address from the wallet's external
@@ -184,10 +184,15 @@ where
184184 }
185185}
186186
187+ /// An error that may occur when inserting a transaction into [`Wallet`].
187188#[ derive( Debug ) ]
188189pub enum InsertTxError {
190+ /// The error variant that occurs when the caller attempts to insert a transaction with a
191+ /// confirmation height that is greater than the internal chain tip.
189192 ConfirmationHeightCannotBeGreaterThanTip {
193+ /// The internal chain's tip height.
190194 tip_height : Option < u32 > ,
195+ /// The introduced transaction's confirmation height.
191196 tx_height : u32 ,
192197 } ,
193198}
0 commit comments