• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitcoindevkit / bdk / 5398026791

pending completion
5398026791

Pull #1002

github

web-flow
Merge 8272aa35d into 26ade1172
Pull Request #1002: Implement linked-list `LocalChain` and add rpc-chain module/example

681 of 681 new or added lines in 9 files covered. (100.0%)

7903 of 10220 relevant lines covered (77.33%)

5078.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

5.0
/crates/esplora/src/lib.rs
1
#![doc = include_str!("../README.md")]
1✔
2
use std::collections::BTreeMap;
3

4
use bdk_chain::{local_chain::CheckPoint, ConfirmationTimeAnchor};
5
use esplora_client::TxStatus;
6

7
pub use esplora_client;
8

9
#[cfg(feature = "blocking")]
10
mod blocking_ext;
11
#[cfg(feature = "blocking")]
12
pub use blocking_ext::*;
13

14
#[cfg(feature = "async")]
15
mod async_ext;
16
#[cfg(feature = "async")]
17
pub use async_ext::*;
18

19
pub(crate) fn confirmation_time_anchor_maker(
×
20
    tip: &CheckPoint,
×
21
) -> impl FnMut(&TxStatus) -> Option<ConfirmationTimeAnchor> {
×
22
    let cache = tip
×
23
        .iter()
×
24
        .take(10)
×
25
        .map(|cp| (cp.height(), cp))
×
26
        .collect::<BTreeMap<u32, CheckPoint>>();
×
27

28
    move |status| match (status.block_time, status.block_height) {
×
29
        (Some(confirmation_time), Some(confirmation_height)) => {
×
30
            let (_, anchor_cp) = cache.range(confirmation_height..).next()?;
×
31

32
            Some(ConfirmationTimeAnchor {
×
33
                anchor_block: anchor_cp.block_id(),
×
34
                confirmation_height,
×
35
                confirmation_time,
×
36
            })
×
37
        }
38
        _ => None,
×
39
    }
×
40
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc