Skip to content

Commit 9d16e1f

Browse files
authored
Merge pull request #159 from rustaceanrob/26-5-12-update
Update `bip157` and release `0.17.0`
2 parents 456cf45 + 7cfc831 commit 9d16e1f

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bdk_kyoto"
3-
version = "0.16.0"
3+
version = "0.17.0"
44
authors = ["Rob rob@2140.dev", "Bitcoin Dev Kit Developers"]
55
description = "BDK blockchain integration using P2P light client Kyoto"
66
license = "MIT OR Apache-2.0"
@@ -13,7 +13,7 @@ rust-version = "1.85.0"
1313

1414
[dependencies]
1515
bdk_wallet = "3"
16-
bip157 = { version = "0.5.0" }
16+
bip157 = { version = "0.6.0" }
1717

1818
[dev-dependencies]
1919
tokio = { version = "1", features = ["full"], default-features = false }

examples/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bdk_kyoto::builder::{Builder, BuilderExt};
2-
use bdk_kyoto::{HeaderCheckpoint, Info, Receiver, ScanType, UnboundedReceiver, Warning};
2+
use bdk_kyoto::{HashCheckpoint, Info, Receiver, ScanType, UnboundedReceiver, Warning};
33
use bdk_wallet::bitcoin::Network;
44
use bdk_wallet::{KeychainKind, Wallet};
55
use tokio::select;
@@ -50,7 +50,7 @@ async fn main() -> anyhow::Result<()> {
5050

5151
let scan_type = ScanType::Recovery {
5252
used_script_index: USER_SCRIPTS_USED,
53-
checkpoint: HeaderCheckpoint::from_genesis(NETWORK),
53+
checkpoint: HashCheckpoint::from_genesis(NETWORK),
5454
};
5555

5656
// The light client builder handles the logic of inserting the SPKs

src/builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use bdk_wallet::{
5454
KeychainKind, Wallet,
5555
};
5656
pub use bip157::Builder;
57-
use bip157::{chain::ChainState, HeaderCheckpoint};
57+
use bip157::{chain::ChainState, HashCheckpoint};
5858

5959
use crate::{state::Idle, LightClient, LoggingSubscribers, ScanType, UpdateSubscriber};
6060

@@ -192,14 +192,14 @@ impl BuilderExt for Builder {
192192
}
193193

194194
/// Walk back 7 blocks in case the last sync was an orphan block.
195-
fn walk_back_max_reorg(checkpoint: CheckPoint) -> HeaderCheckpoint {
196-
let mut ret_cp = HeaderCheckpoint::new(checkpoint.height(), checkpoint.hash());
195+
fn walk_back_max_reorg(checkpoint: CheckPoint) -> HashCheckpoint {
196+
let mut ret_cp = HashCheckpoint::new(checkpoint.height(), checkpoint.hash());
197197
let cp_iter = checkpoint.iter();
198198
for (index, next) in cp_iter.enumerate() {
199199
if index > IMPOSSIBLE_REORG_DEPTH {
200200
return ret_cp;
201201
}
202-
ret_cp = HeaderCheckpoint::new(next.height(), next.hash());
202+
ret_cp = HashCheckpoint::new(next.height(), next.hash());
203203
}
204204
ret_cp
205205
}

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use bip157::IndexedBlock;
5252
use bip157::ScriptBuf;
5353
#[doc(inline)]
5454
pub use bip157::{
55-
BlockHash, ClientError, FeeRate, HeaderCheckpoint, Info, Node, RejectPayload, RejectReason,
55+
BlockHash, ClientError, FeeRate, HashCheckpoint, Info, Node, RejectPayload, RejectReason,
5656
Requester, TrustedPeer, Warning, Wtxid,
5757
};
5858
use bip157::{Event, SyncUpdate};
@@ -324,7 +324,7 @@ impl<W: Wallets> UpdateSubscriber<W> {
324324
single.apply_chain_event(&changeset);
325325
}
326326
if let Some(multiple) = self.multiple_updates_builder.as_mut() {
327-
for (_id, builder) in multiple.iter_mut() {
327+
for builder in multiple.values_mut() {
328328
builder.apply_chain_event(&changeset);
329329
}
330330
}
@@ -343,7 +343,7 @@ impl<W: Wallets> UpdateSubscriber<W> {
343343
single.apply_block_event(&block);
344344
}
345345
if let Some(multiple) = self.multiple_updates_builder.as_mut() {
346-
for (_id, builder) in multiple.iter_mut() {
346+
for builder in multiple.values_mut() {
347347
builder.apply_block_event(&block);
348348
}
349349
}
@@ -353,7 +353,7 @@ impl<W: Wallets> UpdateSubscriber<W> {
353353
.extend(single.peek_script_to_keychain_lookahead());
354354
}
355355
if let Some(multiple) = self.multiple_updates_builder.as_mut() {
356-
for (_id, builder) in multiple.iter() {
356+
for builder in multiple.values() {
357357
self.spk_cache
358358
.extend(builder.peek_script_to_keychain_lookahead());
359359
}
@@ -535,6 +535,6 @@ pub enum ScanType {
535535
/// The amount of scripts used by the wallet that is being recovered.
536536
used_script_index: u32,
537537
/// The height in the block chain to begin searching for transactions.
538-
checkpoint: HeaderCheckpoint,
538+
checkpoint: HashCheckpoint,
539539
},
540540
}

0 commit comments

Comments
 (0)