Skip to content

Commit f6bbb19

Browse files
committed
chore(deps): bump bdk-chain to 0.23.1
- updates the `bdk-chain` to `0.23.1` in `bdk_wallet`. - updates the `esplora`, `electrum` and `bitcoind_rpc` to latest version. - fix `insert_tx` in test_utils to not add last_seen when it's a coinbase tx.
1 parent d0a0abc commit f6bbb19

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

examples/example_wallet_electrum/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ edition = "2021"
55

66
[dependencies]
77
bdk_wallet = { path = "../../wallet", features = ["rusqlite"] }
8-
bdk_electrum = { version = "0.23.0" }
8+
bdk_electrum = { version = "0.23.1" }
99
anyhow = "1"

examples/example_wallet_esplora_async/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ edition = "2021"
77

88
[dependencies]
99
bdk_wallet = { path = "../../wallet", features = ["rusqlite"] }
10-
bdk_esplora = { version = "0.22.0", features = ["async-https", "tokio"] }
10+
bdk_esplora = { version = "0.22.1", features = ["async-https", "tokio"] }
1111
tokio = { version = "1.38.1", features = ["rt", "rt-multi-thread", "macros"] }
1212
anyhow = "1"

examples/example_wallet_esplora_blocking/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ publish = false
88

99
[dependencies]
1010
bdk_wallet = { path = "../../wallet", features = ["rusqlite"] }
11-
bdk_esplora = { version = "0.22.0", features = ["blocking"] }
11+
bdk_esplora = { version = "0.22.1", features = ["blocking"] }
1212
anyhow = "1"

examples/example_wallet_rpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77

88
[dependencies]
99
bdk_wallet = { path = "../../wallet", features = ["rusqlite"] }
10-
bdk_bitcoind_rpc = { version = "0.20.0" }
10+
bdk_bitcoind_rpc = { version = "0.21.0" }
1111

1212
anyhow = "1"
1313
clap = { version = "4.5.17", features = ["derive", "env"] }

examples/example_wallet_rpc/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ fn main() -> anyhow::Result<()> {
174174
}
175175
Emission::Mempool(event) => {
176176
let start_apply_mempool = Instant::now();
177-
wallet.apply_evicted_txs(event.evicted_ats());
178-
wallet.apply_unconfirmed_txs(event.new_txs);
177+
wallet.apply_evicted_txs(event.evicted);
178+
wallet.apply_unconfirmed_txs(event.update);
179179
wallet.persist(&mut db)?;
180180
println!(
181181
"Applied unconfirmed transactions in {}s",

wallet/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ miniscript = { version = "12.3.1", features = [ "serde" ], default-features = fa
2121
bitcoin = { version = "0.32.6", features = [ "serde", "base64" ], default-features = false }
2222
serde = { version = "^1.0", features = ["derive"] }
2323
serde_json = { version = "^1.0" }
24-
bdk_chain = { version = "0.23.0", features = [ "miniscript", "serde" ], default-features = false }
24+
bdk_chain = { version = "0.23.1", features = [ "miniscript", "serde" ], default-features = false }
2525

2626
# Optional dependencies
2727
bip39 = { version = "2.0", optional = true }
28-
bdk_file_store = { version = "0.21.0", optional = true }
28+
bdk_file_store = { version = "0.21.1", optional = true }
2929

3030
[features]
3131
default = ["std"]
@@ -40,7 +40,7 @@ test-utils = ["std"]
4040
[dev-dependencies]
4141
assert_matches = "1.5.0"
4242
tempfile = "3"
43-
bdk_chain = { version = "0.23.0", features = ["rusqlite"] }
43+
bdk_chain = { version = "0.23.1", features = ["rusqlite"] }
4444
bdk_wallet = { path = ".", features = ["rusqlite", "file_store", "test-utils"] }
4545
anyhow = "1"
4646
rand = "^0.8"

wallet/src/test_utils.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,15 @@ pub fn insert_checkpoint(wallet: &mut Wallet, block: BlockId) {
322322
/// This can be used, for example, to track a transaction immediately after it is broadcast.
323323
pub fn insert_tx(wallet: &mut Wallet, tx: Transaction) {
324324
let txid = tx.compute_txid();
325-
let seen_at = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
326325
let mut tx_update = TxUpdate::default();
326+
327+
// coinbase txs must not have `last_seen`, when in mempool.
328+
if !tx.is_coinbase() {
329+
let seen_at = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
330+
tx_update.seen_ats = [(txid, seen_at)].into();
331+
};
332+
327333
tx_update.txs = vec![Arc::new(tx)];
328-
tx_update.seen_ats = [(txid, seen_at)].into();
329334
wallet
330335
.apply_update(Update {
331336
tx_update,

0 commit comments

Comments
 (0)