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

payjoin / rust-payjoin / 13597174622

28 Feb 2025 09:56PM UTC coverage: 79.747% (+0.4%) from 79.302%
13597174622

Pull #434

github

web-flow
Merge 2715774b0 into 8777c16f3
Pull Request #434: Multiparty Senders: NS1R

423 of 493 new or added lines in 9 files covered. (85.8%)

3 existing lines in 2 files now uncovered.

4544 of 5698 relevant lines covered (79.75%)

810.38 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(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 {
NEW
24
    fn from(e: InternalMultiPartyError) -> Self { MultiPartyError(e) }
×
25
}
26

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

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