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

bitcoindevkit / bdk / 10539621204

24 Aug 2024 03:32PM UTC coverage: 82.079% (+0.2%) from 81.848%
10539621204

Pull #1569

github

web-flow
Merge 48259deeb into 9e6ac72a6
Pull Request #1569: `bdk_core` WIP WIP WIP

533 of 616 new or added lines in 16 files covered. (86.53%)

5 existing lines in 4 files now uncovered.

11230 of 13682 relevant lines covered (82.08%)

13503.08 hits per line

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

75.0
/crates/core/src/chain_data.rs
1
use bitcoin::{hashes::Hash, BlockHash};
2

3
/// A reference to a block in the canonical chain.
4
#[derive(Debug, Clone, PartialEq, Eq, Copy, PartialOrd, Ord, core::hash::Hash)]
NEW
5
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
×
6
pub struct BlockId {
7
    /// The height of the block.
8
    pub height: u32,
9
    /// The hash of the block.
10
    pub hash: BlockHash,
11
}
12

13
impl Default for BlockId {
14
    fn default() -> Self {
132✔
15
        Self {
132✔
16
            height: Default::default(),
132✔
17
            hash: BlockHash::all_zeros(),
132✔
18
        }
132✔
19
    }
132✔
20
}
21

22
impl From<(u32, BlockHash)> for BlockId {
23
    fn from((height, hash): (u32, BlockHash)) -> Self {
15,136✔
24
        Self { height, hash }
15,136✔
25
    }
15,136✔
26
}
27

28
impl From<BlockId> for (u32, BlockHash) {
NEW
29
    fn from(block_id: BlockId) -> Self {
×
NEW
30
        (block_id.height, block_id.hash)
×
NEW
31
    }
×
32
}
33

34
impl From<(&u32, &BlockHash)> for BlockId {
35
    fn from((height, hash): (&u32, &BlockHash)) -> Self {
10,956✔
36
        Self {
10,956✔
37
            height: *height,
10,956✔
38
            hash: *hash,
10,956✔
39
        }
10,956✔
40
    }
10,956✔
41
}
42

43
/// Represents the confirmation block and time of a transaction.
44
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy, PartialOrd, Ord, core::hash::Hash)]
NEW
45
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
×
46
pub struct ConfirmationBlockTime {
47
    /// The anchor block.
48
    pub block_id: BlockId,
49
    /// The confirmation time of the transaction being anchored.
50
    pub confirmation_time: u64,
51
}
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