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

payjoin / rust-payjoin / 15280364074

27 May 2025 04:13PM UTC coverage: 41.223% (-43.3%) from 84.553%
15280364074

Pull #705

github

web-flow
Merge 34cbcca7d into 87042266d
Pull Request #705: Adjust _danger-local-https to be the default to prevent dangerous cert vulnerability when building with --all-features

1 of 1 new or added line in 1 file covered. (100.0%)

1600 existing lines in 30 files now uncovered.

1705 of 4136 relevant lines covered (41.22%)

0.59 hits per line

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

0.0
/payjoin/src/error_codes.rs
1
//! Well-known error codes as defined in BIP-78
2
//! See: <https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#receivers-well-known-errors>
3

4
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5
pub enum ErrorCode {
6
    /// The payjoin endpoint is not available for now.
7
    Unavailable,
8
    /// The receiver added some inputs but could not bump the fee of the payjoin proposal.
9
    NotEnoughMoney,
10
    /// This version of payjoin is not supported.
11
    VersionUnsupported,
12
    /// The receiver rejected the original PSBT.
13
    OriginalPsbtRejected,
14
}
15

16
impl ErrorCode {
UNCOV
17
    pub const fn as_str(&self) -> &'static str {
×
UNCOV
18
        match self {
×
UNCOV
19
            Self::Unavailable => "unavailable",
×
20
            Self::NotEnoughMoney => "not-enough-money",
×
21
            Self::VersionUnsupported => "version-unsupported",
×
UNCOV
22
            Self::OriginalPsbtRejected => "original-psbt-rejected",
×
23
        }
UNCOV
24
    }
×
25
}
26

27
impl core::str::FromStr for ErrorCode {
28
    type Err = ();
29

UNCOV
30
    fn from_str(s: &str) -> Result<Self, Self::Err> {
×
UNCOV
31
        match s {
×
UNCOV
32
            "unavailable" => Ok(Self::Unavailable),
×
UNCOV
33
            "not-enough-money" => Ok(Self::NotEnoughMoney),
×
UNCOV
34
            "version-unsupported" => Ok(Self::VersionUnsupported),
×
UNCOV
35
            "original-psbt-rejected" => Ok(Self::OriginalPsbtRejected),
×
UNCOV
36
            _ => Err(()),
×
37
        }
UNCOV
38
    }
×
39
}
40

41
impl core::fmt::Display for ErrorCode {
UNCOV
42
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
×
UNCOV
43
        f.write_str(self.as_str())
×
UNCOV
44
    }
×
45
}
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