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

payjoin / rust-payjoin / 15595573901

11 Jun 2025 09:01PM UTC coverage: 85.952% (+0.3%) from 85.622%
15595573901

Pull #748

github

web-flow
Merge 376346073 into 8a6344ec6
Pull Request #748: Full mutation coverage on send in the payjoin crate

100 of 103 new or added lines in 3 files covered. (97.09%)

19 existing lines in 3 files now uncovered.

7134 of 8300 relevant lines covered (85.95%)

559.49 hits per line

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

0.0
/payjoin/src/send/multiparty/error.rs
1
use std::fmt::{self, Display};
2

3
use bitcoin::psbt::Error as PsbtError;
4

5
use crate::hpke::HpkeError;
6
use crate::ohttp::OhttpEncapsulationError;
7
use crate::send::InternalProposalError;
8
use crate::uri::url_ext::ParseReceiverPubkeyParamError;
9
use crate::ImplementationError;
10

11
#[derive(Debug)]
12
pub struct CreateRequestError(InternalCreateRequestError);
13

14
#[derive(Debug)]
15
pub(crate) enum InternalCreateRequestError {
16
    #[allow(dead_code)]
17
    Expired(std::time::SystemTime),
18
    MissingOhttpConfig,
19
    ParseReceiverPubkeyParam(ParseReceiverPubkeyParamError),
20
    V2CreateRequest(crate::send::v2::CreateRequestError),
21
}
22

23
impl From<InternalCreateRequestError> for CreateRequestError {
24
    fn from(value: InternalCreateRequestError) -> Self { CreateRequestError(value) }
×
25
}
26

27
impl Display for CreateRequestError {
28
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self.0) }
×
29
}
30

31
impl std::error::Error for CreateRequestError {
32
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
×
33
        match &self.0 {
×
34
            InternalCreateRequestError::Expired(_) => None,
×
35
            InternalCreateRequestError::MissingOhttpConfig => None,
×
36
            InternalCreateRequestError::ParseReceiverPubkeyParam(e) => Some(e),
×
37
            InternalCreateRequestError::V2CreateRequest(e) => Some(e),
×
38
        }
39
    }
×
40
}
41

42
#[derive(Debug)]
43
pub struct FinalizedError(InternalFinalizedError);
44

45
#[derive(Debug)]
46
pub(crate) enum InternalFinalizedError {
47
    Hpke(HpkeError),
48
    InvalidSize,
49
    #[allow(dead_code)]
50
    FinalizePsbt(ImplementationError),
51
    MissingResponse,
52
    Psbt(PsbtError),
53
    #[allow(dead_code)]
54
    UnexpectedStatusCode(http::StatusCode),
55
    Proposal(InternalProposalError),
56
    Ohttp(OhttpEncapsulationError),
57
}
58

59
impl From<InternalFinalizedError> for FinalizedError {
60
    fn from(value: InternalFinalizedError) -> Self { FinalizedError(value) }
×
61
}
62

63
impl Display for FinalizedError {
64
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self.0) }
×
65
}
66

67
impl std::error::Error for FinalizedError {
UNCOV
68
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
×
UNCOV
69
        match &self.0 {
×
UNCOV
70
            InternalFinalizedError::Hpke(e) => Some(e),
×
71
            InternalFinalizedError::InvalidSize => None,
×
72
            InternalFinalizedError::FinalizePsbt(_) => None,
×
73
            InternalFinalizedError::MissingResponse => None,
×
74
            InternalFinalizedError::Psbt(e) => Some(e),
×
75
            InternalFinalizedError::UnexpectedStatusCode(_) => None,
×
76
            InternalFinalizedError::Proposal(e) => Some(e),
×
77
            InternalFinalizedError::Ohttp(e) => Some(e),
×
78
        }
UNCOV
79
    }
×
80
}
81

82
#[derive(Debug)]
83
pub struct FinalizeResponseError(InternalFinalizeResponseError);
84

85
#[derive(Debug)]
86
pub(crate) enum InternalFinalizeResponseError {
87
    #[allow(dead_code)]
88
    InvalidSize(usize),
89
    Ohttp(OhttpEncapsulationError),
90
    #[allow(dead_code)]
91
    UnexpectedStatusCode(http::StatusCode),
92
}
93

94
impl From<InternalFinalizeResponseError> for FinalizeResponseError {
95
    fn from(value: InternalFinalizeResponseError) -> Self { FinalizeResponseError(value) }
×
96
}
97

98
impl Display for FinalizeResponseError {
99
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self.0) }
×
100
}
101

102
impl std::error::Error for FinalizeResponseError {
UNCOV
103
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
×
UNCOV
104
        match &self.0 {
×
UNCOV
105
            InternalFinalizeResponseError::InvalidSize(_) => None,
×
106
            InternalFinalizeResponseError::Ohttp(e) => Some(e),
×
107
            InternalFinalizeResponseError::UnexpectedStatusCode(_) => None,
×
108
        }
109
    }
×
110
}
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

© 2026 Coveralls, Inc