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

payjoin / rust-payjoin / 13637705402

03 Mar 2025 06:23PM UTC coverage: 79.725% (+0.4%) from 79.302%
13637705402

push

github

web-flow
Multiparty Senders: NS1R (#434)

Let a receiver batch sends from multiple peers into one transaction.

407 of 477 new or added lines in 9 files covered. (85.32%)

1 existing line in 1 file now uncovered.

4530 of 5682 relevant lines covered (79.73%)

812.66 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 {
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