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 @@ -94,9 +94,9 @@ pub struct Wallet<D = ()> {
9494 secp : SecpCtx ,
9595}
9696
97- /// A structure to update [`KeychainTxOutIndex`], [`TxGraph`] and [`LocalChain`] atomically .
97+ /// A structure to update [`Wallet`] .
9898///
99- /// [`LocalChain`]: local_chain::LocalChain
99+ /// It updates [`bdk_chain::keychain::KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [` local_chain::LocalChain`] atomically.
100100#[ derive( Debug , Clone ) ]
101101pub struct WalletUpdate < K , A > {
102102 /// Contains the last active derivation indices per keychain (`K`), which is used to update the
@@ -112,13 +112,12 @@ pub struct WalletUpdate<K, A> {
112112 pub chain : Option < local_chain:: Update > ,
113113}
114114
115- impl < K , A > WalletUpdate < K , A > {
116- /// Construct a [`WalletUpdate`] with a given [`local_chain::Update`].
117- pub fn new ( chain_update : local_chain:: Update ) -> Self {
115+ impl < K , A > Default for WalletUpdate < K , A > {
116+ fn default ( ) -> Self {
118117 Self {
119118 last_active_indices : BTreeMap :: new ( ) ,
120119 graph : TxGraph :: default ( ) ,
121- chain : Some ( chain_update ) ,
120+ chain : None ,
122121 }
123122 }
124123}
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