Skip to content

Commit

Permalink
[wallet_redesign] Update Wallet with redesigned structures
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed May 11, 2023
1 parent ed89de7 commit e5de79f
Show file tree
Hide file tree
Showing 9 changed files with 756 additions and 527 deletions.
8 changes: 5 additions & 3 deletions crates/bdk/src/wallet/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
use core::str::FromStr;

use alloc::string::{String, ToString};
use bdk_chain::sparse_chain::ChainPosition;
use serde::{Deserialize, Serialize};

use miniscript::descriptor::{ShInner, WshInner};
Expand Down Expand Up @@ -130,8 +129,10 @@ impl FullyNodedExport {
wallet
.transactions()
.next()
.and_then(|(pos, _)| pos.height().into())
.unwrap_or(0)
.map_or(0, |canonical_tx| match canonical_tx.observed_as {
bdk_chain::ObservedAs::Confirmed(a) => a.confirmation_height,
bdk_chain::ObservedAs::Unconfirmed(_) => 0,
})
} else {
0
};
Expand Down Expand Up @@ -246,6 +247,7 @@ mod test {
height: 5000,
time: 0,
},
None,
)
.unwrap();
wallet
Expand Down

0 comments on commit e5de79f

Please sign in to comment.