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

payjoin / rust-payjoin / 16977800232

14 Aug 2025 10:07PM UTC coverage: 86.259% (+0.3%) from 85.916%
16977800232

push

github

web-flow
Replace bitcoincore-rpc with custom reqwest client (#945)

Eliminates minreq dependency conflict and adds HTTPS support by
implementing async RPC client using reqwest and corepc-types.

- Uses project-wide reqwest instead of minreq
- Enables HTTPS connections via rustls
- Implements 9 required RPC methods with sync wrapper
- Supports cookie file and username/password auth

Fixes #350

227 of 238 new or added lines in 5 files covered. (95.38%)

40 existing lines in 5 files now uncovered.

7709 of 8937 relevant lines covered (86.26%)

521.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/payjoin-cli/src/main.rs
1
use anyhow::Result;
2
use app::config::Config;
3
use app::App as AppTrait;
4
use clap::Parser;
5
use cli::{Cli, Commands};
6

7
mod app;
8
mod cli;
9
mod db;
10

11
#[cfg(not(any(feature = "v1", feature = "v2")))]
12
compile_error!("At least one of the features ['v1', 'v2'] must be enabled");
13

14
#[tokio::main]
15
async fn main() -> Result<()> {
10✔
16
    env_logger::init();
10✔
17

18
    let cli = Cli::parse();
10✔
19
    let config = Config::new(&cli)?;
10✔
20

21
    #[allow(clippy::if_same_then_else)]
22
    let app: Box<dyn AppTrait> = if cli.flags.bip78.unwrap_or(false) {
10✔
23
        #[cfg(feature = "v1")]
24
        {
25
            Box::new(crate::app::v1::App::new(config).await?)
4✔
26
        }
27
        #[cfg(not(feature = "v1"))]
28
        {
29
            anyhow::bail!(
30
                "BIP78 (v1) support is not enabled in this build. Recompile with --features v1"
31
            )
32
        }
33
    } else if cli.flags.bip77.unwrap_or(false) {
6✔
34
        #[cfg(feature = "v2")]
35
        {
NEW
36
            Box::new(crate::app::v2::App::new(config).await?)
×
37
        }
38
        #[cfg(not(feature = "v2"))]
39
        {
40
            anyhow::bail!(
×
41
                "BIP77 (v2) support is not enabled in this build. Recompile with --features v2"
×
42
            )
43
        }
44
    } else {
45
        #[cfg(feature = "v2")]
46
        {
47
            Box::new(crate::app::v2::App::new(config).await?)
6✔
48
        }
49
        #[cfg(all(feature = "v1", not(feature = "v2")))]
50
        {
NEW
51
            Box::new(crate::app::v1::App::new(config).await?)
×
52
        }
53
        #[cfg(not(any(feature = "v1", feature = "v2")))]
54
        {
55
            anyhow::bail!("No valid version available - must compile with v1 or v2 feature")
56
        }
57
    };
58

59
    match &cli.command {
10✔
60
        Commands::Send { bip21, fee_rate } => {
4✔
61
            app.send_payjoin(bip21, *fee_rate).await?;
4✔
62
        }
63
        Commands::Receive { amount, .. } => {
3✔
64
            app.receive_payjoin(*amount).await?;
3✔
65
        }
66
        #[cfg(feature = "v2")]
67
        Commands::Resume => {
68
            app.resume_payjoins().await?;
3✔
69
        }
70
    };
71

72
    Ok(())
18✔
73
}
10✔
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