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

payjoin / rust-payjoin / 14646658670

24 Apr 2025 04:26PM UTC coverage: 81.905% (+0.07%) from 81.835%
14646658670

Pull #667

github

web-flow
Merge c9850f1a2 into 3b23dcaf5
Pull Request #667: Fix uninline format clippy violations

50 of 147 new or added lines in 30 files covered. (34.01%)

5 existing lines in 3 files now uncovered.

5323 of 6499 relevant lines covered (81.9%)

711.52 hits per line

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

0.0
/payjoin/src/receive/multiparty/error.rs
1
use core::fmt;
2
use std::error;
3

4
#[derive(Debug)]
5
pub struct MultipartyError(InternalMultipartyError);
6

7
#[derive(Debug)]
8
pub(crate) enum InternalMultipartyError {
9
    /// Not enough proposals
10
    NotEnoughProposals,
11
    /// Proposal version not supported
12
    ProposalVersionNotSupported(usize),
13
    /// Optimistic merge not supported
14
    OptimisticMergeNotSupported,
15
    /// Bitcoin Internal Error
16
    BitcoinExtractTxError(Box<bitcoin::psbt::ExtractTxError>),
17
    /// Input in Finalized Proposal is missing witness or script_sig
18
    InputMissingWitnessOrScriptSig,
19
    /// Failed to combine psbts
20
    FailedToCombinePsbts(bitcoin::psbt::Error),
21
}
22

23
impl From<InternalMultipartyError> for MultipartyError {
24
    fn from(e: InternalMultipartyError) -> Self { MultipartyError(e) }
×
25
}
26

27
impl fmt::Display for MultipartyError {
28
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
×
29
        match &self.0 {
×
30
            InternalMultipartyError::NotEnoughProposals => write!(f, "Not enough proposals"),
×
31
            InternalMultipartyError::ProposalVersionNotSupported(v) =>
×
NEW
32
                write!(f, "Proposal version not supported: {v}"),
×
33
            InternalMultipartyError::OptimisticMergeNotSupported =>
34
                write!(f, "Optimistic merge not supported"),
×
35
            InternalMultipartyError::BitcoinExtractTxError(e) =>
×
NEW
36
                write!(f, "Bitcoin extract tx error: {e}"),
×
37
            InternalMultipartyError::InputMissingWitnessOrScriptSig =>
38
                write!(f, "Input in Finalized Proposal is missing witness or script_sig"),
×
39
            InternalMultipartyError::FailedToCombinePsbts(e) =>
×
NEW
40
                write!(f, "Failed to combine psbts: {e}"),
×
41
        }
42
    }
×
43
}
44

45
impl error::Error for MultipartyError {
46
    fn source(&self) -> Option<&(dyn error::Error + 'static)> {
×
47
        match &self.0 {
×
48
            InternalMultipartyError::NotEnoughProposals => None,
×
49
            InternalMultipartyError::ProposalVersionNotSupported(_) => None,
×
50
            InternalMultipartyError::OptimisticMergeNotSupported => None,
×
51
            InternalMultipartyError::BitcoinExtractTxError(e) => Some(e),
×
52
            InternalMultipartyError::InputMissingWitnessOrScriptSig => None,
×
53
            InternalMultipartyError::FailedToCombinePsbts(e) => Some(e),
×
54
        }
55
    }
×
56
}
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