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

bitcoindevkit / bdk / 10348217438

12 Aug 2024 08:10AM CUT coverage: 81.794% (-0.02%) from 81.813%
10348217438

Pull #1535

github

web-flow
Merge 2c0bc45ec into 98c49592d
Pull Request #1535: test(electrum): Test sync in reorg and no-reorg situations

19 of 25 new or added lines in 1 file covered. (76.0%)

1 existing line in 1 file now uncovered.

10908 of 13336 relevant lines covered (81.79%)

12995.15 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 {
1,018✔
11
    DefaultOptions::new().with_varint_encoding()
1,018✔
12
}
1,018✔
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