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

payjoin / rust-payjoin / 14668093016

25 Apr 2025 03:28PM UTC coverage: 81.779% (-0.2%) from 81.936%
14668093016

Pull #668

github

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

16 of 29 new or added lines in 6 files covered. (55.17%)

9 existing lines in 2 files now uncovered.

5332 of 6520 relevant lines covered (81.78%)

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

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

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

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

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

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