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

payjoin / rust-payjoin / 14668081009

25 Apr 2025 03:27PM UTC coverage: 81.936% (+0.1%) from 81.835%
14668081009

push

github

web-flow
Fix uninline format rust 1.88.0 clippy violations (#667)

50 of 145 new or added lines in 30 files covered. (34.48%)

3 existing lines in 2 files now uncovered.

5325 of 6499 relevant lines covered (81.94%)

711.53 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