Skip to content

Commit e69fccb

Browse files
committed
[wallet_redesign] Update Wallet with redesigned structures
1 parent 8641847 commit e69fccb

9 files changed

Lines changed: 756 additions & 527 deletions

File tree

crates/bdk/src/wallet/export.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
use core::str::FromStr;
5757

5858
use alloc::string::{String, ToString};
59-
use bdk_chain::sparse_chain::ChainPosition;
6059
use serde::{Deserialize, Serialize};
6160

6261
use miniscript::descriptor::{ShInner, WshInner};
@@ -130,8 +129,10 @@ impl FullyNodedExport {
130129
wallet
131130
.transactions()
132131
.next()
133-
.and_then(|(pos, _)| pos.height().into())
134-
.unwrap_or(0)
132+
.map_or(0, |canonical_tx| match canonical_tx.observed_as {
133+
bdk_chain::ObservedAs::Confirmed(a) => a.confirmation_height,
134+
bdk_chain::ObservedAs::Unconfirmed(_) => 0,
135+
})
135136
} else {
136137
0
137138
};
@@ -246,6 +247,7 @@ mod test {
246247
height: 5000,
247248
time: 0,
248249
},
250+
None,
249251
)
250252
.unwrap();
251253
wallet

0 commit comments

Comments
 (0)