File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
wallet_esplora_blocking/src Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ pub struct Wallet<D = ()> {
9595 secp : SecpCtx ,
9696}
9797
98- /// A structure to update [`KeychainTxOutIndex`], [`TxGraph`] and [`LocalChain`] atomically .
98+ /// A structure to update [`Wallet`] .
9999///
100- /// [`LocalChain`]: local_chain::LocalChain
100+ /// It updates [`bdk_chain::keychain::KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [` local_chain::LocalChain`] atomically.
101101#[ derive( Debug , Clone ) ]
102102pub struct WalletUpdate < K , A > {
103103 /// Contains the last active derivation indices per keychain (`K`), which is used to update the
@@ -113,13 +113,12 @@ pub struct WalletUpdate<K, A> {
113113 pub chain : Option < local_chain:: Update > ,
114114}
115115
116- impl < K , A > WalletUpdate < K , A > {
117- /// Construct a [`WalletUpdate`] with a given [`local_chain::Update`].
118- pub fn new ( chain_update : local_chain:: Update ) -> Self {
116+ impl < K , A > Default for WalletUpdate < K , A > {
117+ fn default ( ) -> Self {
119118 Self {
120119 last_active_indices : BTreeMap :: new ( ) ,
121120 graph : TxGraph :: default ( ) ,
122- chain : Some ( chain_update ) ,
121+ chain : None ,
123122 }
124123 }
125124}
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
6161 let update = WalletUpdate {
6262 last_active_indices,
6363 graph : update_graph,
64- .. WalletUpdate :: new ( chain_update)
64+ chain : Some ( chain_update) ,
6565 } ;
6666 wallet. apply_update ( update) ?;
6767 wallet. commit ( ) ?;
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
6060 let update = WalletUpdate {
6161 last_active_indices,
6262 graph : update_graph,
63- .. WalletUpdate :: new ( chain_update)
63+ chain : Some ( chain_update) ,
6464 } ;
6565
6666 wallet. apply_update ( update) ?;
You can’t perform that action at this time.
0 commit comments