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

bitcoindevkit / bdk / 9713429358

28 Jun 2024 01:15PM UTC coverage: 83.028% (+0.004%) from 83.024%
9713429358

Pull #1493

github

web-flow
Merge eae3ffe96 into 5c7cc3097
Pull Request #1493: [chain] Create module `keychain_txout_index`

15 of 17 new or added lines in 5 files covered. (88.24%)

1 existing line in 1 file now uncovered.

11051 of 13310 relevant lines covered (83.03%)

16853.48 hits per line

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

40.0
/crates/file_store/src/lib.rs
1
#![doc = include_str!("../README.md")]
2
mod entry_iter;
3
mod store;
4
use std::io;
5

6
use bincode::{DefaultOptions, Options};
7
pub use entry_iter::*;
8
pub use store::*;
9

10
pub(crate) fn bincode_options() -> impl bincode::Options {
920✔
11
    DefaultOptions::new().with_varint_encoding()
920✔
12
}
920✔
13

14
/// Error that occurs due to problems encountered with the file.
15
#[derive(Debug)]
16
pub enum FileError {
17
    /// IO error, this may mean that the file is too short.
18
    Io(io::Error),
19
    /// Magic bytes do not match what is expected.
20
    InvalidMagicBytes { got: Vec<u8>, expected: Vec<u8> },
21
}
22

23
impl core::fmt::Display for FileError {
24
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
×
25
        match self {
×
26
            Self::Io(e) => write!(f, "io error trying to read file: {}", e),
×
27
            Self::InvalidMagicBytes { got, expected } => write!(
×
28
                f,
×
29
                "file has invalid magic bytes: expected={:?} got={:?}",
×
30
                expected, got,
×
31
            ),
×
32
        }
33
    }
×
34
}
35

36
impl From<io::Error> for FileError {
37
    fn from(value: io::Error) -> Self {
2✔
38
        Self::Io(value)
2✔
39
    }
2✔
40
}
41

42
impl std::error::Error for FileError {}
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