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

payjoin / rust-payjoin / 14668113135

25 Apr 2025 03:29PM UTC coverage: 81.81% (-0.1%) from 81.936%
14668113135

Pull #668

github

web-flow
Merge badd2c7df into a7e122e28
Pull Request #668: Introduce Payjoin version enum

18 of 31 new or added lines in 6 files covered. (58.06%)

17 existing lines in 3 files now uncovered.

5334 of 6520 relevant lines covered (81.81%)

709.24 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
use crate::Version;
5

6
#[derive(Debug)]
7
pub struct MultipartyError(InternalMultipartyError);
8

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

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

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

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