From 387d9420ac690b9304dc9e0ed713df0a9d49a02e Mon Sep 17 00:00:00 2001 From: Mshehu5 Date: Thu, 11 Dec 2025 01:28:30 +0100 Subject: [PATCH 1/3] Remove unused UDL filter from flake sources drop the .udl match from the cleanSourceWith filter as Uniffi does not use .udl files anymore --- flake.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 85e16184f..ff04be650 100644 --- a/flake.nix +++ b/flake.nix @@ -66,9 +66,7 @@ src = ./.; filter = path: type: - (builtins.match ".*.udl$" path != null) - || (builtins.match ".*nginx.conf.template$" path != null) - || (craneLib.filterCargoSources path type); + (builtins.match ".*nginx.conf.template$" path != null) || (craneLib.filterCargoSources path type); name = "source"; }; commonArgs = { From 3f6d4f8833efbdcd7de5f24ecae7bd1a5cebb1d0 Mon Sep 17 00:00:00 2001 From: Mshehu5 Date: Thu, 11 Dec 2025 01:32:57 +0100 Subject: [PATCH 2/3] Add cargo machete flake check for unused deps enforces unused dependency detection in nix flake check --- flake.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index ff04be650..fd77bbedf 100644 --- a/flake.nix +++ b/flake.nix @@ -186,6 +186,18 @@ } ); + payjoin-workspace-machete = craneLib.mkCargoDerivation ( + commonArgs + // { + pname = "payjoin-workspace-machete"; + inherit cargoArtifacts; + nativeBuildInputs = [ pkgs.cargo-machete ]; + buildPhaseCargoCommand = ""; + checkPhaseCargoCommand = "cargo machete"; + doCheck = true; + } + ); + payjoin-workspace-clippy = craneLib.cargoClippy ( commonArgs // { From fe4858ce6e485e8dbc202fb89e9a207a3df7c20a Mon Sep 17 00:00:00 2001 From: Mshehu5 Date: Thu, 11 Dec 2025 03:19:50 +0100 Subject: [PATCH 3/3] Prune unused dependency Dropped unused dependency flagged by cargo machete across codebase. Kept getrandom because the wasm_js feature requires getrandom/js and marked it ignored in machete metadata --- Cargo-minimal.lock | 8 -------- Cargo-recent.lock | 8 -------- payjoin-cli/Cargo.toml | 6 +----- payjoin-directory/Cargo.toml | 3 +-- payjoin-ffi/Cargo.toml | 7 +++++-- payjoin-ffi/dart/native/Cargo.toml | 2 -- payjoin-test-utils/Cargo.toml | 1 - 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index b9007fb07..1777bf233 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -2473,22 +2473,18 @@ dependencies = [ "clap", "config", "dirs", - "futures", "http-body-util", "hyper", - "hyper-rustls", "hyper-util", "nix", "payjoin", "payjoin-test-utils", "r2d2", "r2d2_sqlite", - "rcgen 0.14.3", "reqwest", "rusqlite", "serde", "serde_json", - "sled", "tempfile", "tokio", "tokio-rustls", @@ -2510,7 +2506,6 @@ dependencies = [ "futures", "http-body-util", "hyper", - "hyper-rustls", "hyper-util", "payjoin", "prometheus", @@ -2529,12 +2524,10 @@ dependencies = [ name = "payjoin-ffi" version = "0.24.0" dependencies = [ - "base64 0.22.1", "bdk", "bitcoin-ffi", "bitcoin-ohttp", "getrandom 0.2.15", - "hex", "lazy_static", "payjoin", "payjoin-test-utils", @@ -2555,7 +2548,6 @@ dependencies = [ "bitcoin-ohttp", "corepc-node", "http", - "log", "ohttp-relay", "once_cell", "payjoin", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index b9007fb07..1777bf233 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -2473,22 +2473,18 @@ dependencies = [ "clap", "config", "dirs", - "futures", "http-body-util", "hyper", - "hyper-rustls", "hyper-util", "nix", "payjoin", "payjoin-test-utils", "r2d2", "r2d2_sqlite", - "rcgen 0.14.3", "reqwest", "rusqlite", "serde", "serde_json", - "sled", "tempfile", "tokio", "tokio-rustls", @@ -2510,7 +2506,6 @@ dependencies = [ "futures", "http-body-util", "hyper", - "hyper-rustls", "hyper-util", "payjoin", "prometheus", @@ -2529,12 +2524,10 @@ dependencies = [ name = "payjoin-ffi" version = "0.24.0" dependencies = [ - "base64 0.22.1", "bdk", "bitcoin-ffi", "bitcoin-ohttp", "getrandom 0.2.15", - "hex", "lazy_static", "payjoin", "payjoin-test-utils", @@ -2555,7 +2548,6 @@ dependencies = [ "bitcoin-ohttp", "corepc-node", "http", - "log", "ohttp-relay", "once_cell", "payjoin", diff --git a/payjoin-cli/Cargo.toml b/payjoin-cli/Cargo.toml index 8e5a65be8..b5487afb1 100644 --- a/payjoin-cli/Cargo.toml +++ b/payjoin-cli/Cargo.toml @@ -21,7 +21,7 @@ path = "src/main.rs" [features] default = ["v2"] native-certs = ["reqwest/rustls-tls-native-roots"] -_manual-tls = ["rcgen", "reqwest/rustls-tls", "hyper-rustls", "payjoin/_manual-tls", "tokio-rustls"] +_manual-tls = ["reqwest/rustls-tls", "payjoin/_manual-tls", "tokio-rustls"] v1 = ["payjoin/v1","hyper", "hyper-util", "http-body-util"] v2 = ["payjoin/v2", "payjoin/io"] @@ -31,20 +31,16 @@ async-trait = "0.1.89" bitcoind-async-client = {git = "https://github.com/arminsabouri/bitcoind-async-client", rev = "956ca693e4263c003eaa4fa938d909d24acac5fa"} clap = { version = "4.5.45", features = ["derive"] } config = "0.15.14" -futures = "0.3.31" http-body-util = { version = "0.1.3", optional = true } hyper = { version = "1.6.0", features = ["http1", "server"], optional = true } -hyper-rustls = { version = "0.27.7", default-features=false, features = ["ring"], optional = true } hyper-util = { version = "0.1.16", optional = true } payjoin = { version = "1.0.0-rc.1", default-features = false } r2d2 = "0.8.10" r2d2_sqlite = "0.22.0" -rcgen = { version = "0.14.3", optional = true } reqwest = { version = "0.12.23", default-features = false, features = ["json", "rustls-tls"] } rusqlite = { version = "0.29.0", features = ["bundled"] } serde_json = "1.0.142" serde = { version = "1.0.219", features = ["derive"] } -sled = "0.34.7" tokio = { version = "1.47.1", features = ["full"] } tokio-rustls = { version = "0.26.2", features = ["ring"], default-features = false, optional = true } url = { version = "2.5.4", features = ["serde"] } diff --git a/payjoin-directory/Cargo.toml b/payjoin-directory/Cargo.toml index a0d3aff4d..f08300755 100644 --- a/payjoin-directory/Cargo.toml +++ b/payjoin-directory/Cargo.toml @@ -15,7 +15,7 @@ resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -_manual-tls = ["hyper-rustls", "tokio-rustls"] +_manual-tls = ["tokio-rustls"] acme = ["tokio-rustls-acme"] [dependencies] @@ -25,7 +25,6 @@ bhttp = { version = "0.6.1", features = ["http"] } futures = "0.3.31" http-body-util = "0.1.3" hyper = { version = "1.6.0", features = ["http1", "server"] } -hyper-rustls = { version = "0.27.7", default-features=false, features = ["webpki-roots", "http1", "ring"], optional=true } hyper-util = { version = "0.1.16", features = ["tokio"] } ohttp = { package = "bitcoin-ohttp", version = "0.6.0"} payjoin = { version = "1.0.0-rc.1", features = ["directory"], default-features = false } diff --git a/payjoin-ffi/Cargo.toml b/payjoin-ffi/Cargo.toml index aa7049418..1e48a1db8 100644 --- a/payjoin-ffi/Cargo.toml +++ b/payjoin-ffi/Cargo.toml @@ -22,10 +22,8 @@ name = "uniffi-bindgen" path = "uniffi-bindgen.rs" [dependencies] -base64 = "0.22.1" bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi", rev = "39cc12b" } getrandom = "0.2" -hex = "0.4.3" lazy_static = "1.5.0" ohttp = { package = "bitcoin-ohttp", version = "0.6.0" } payjoin = { version = "1.0.0-rc.1", features = ["v1", "v2"] } @@ -38,5 +36,10 @@ uniffi-dart = { git = "https://github.com/Uniffi-Dart/uniffi-dart.git", rev = "5 uniffi = { version = "0.30.0" } url = "2.5.4" +# getrandom is ignored here because it's required by the wasm_js feature +# Even though it may appear unused in the default feature set, it's a legitimate dependency for WASM builds. +[package.metadata.cargo-machete] +ignored = ["getrandom"] + [dev-dependencies] bdk = { version = "0.29.0", features = ["all-keys", "use-esplora-ureq", "keys-bip39", "rpc"] } diff --git a/payjoin-ffi/dart/native/Cargo.toml b/payjoin-ffi/dart/native/Cargo.toml index c229703c2..4b120831d 100644 --- a/payjoin-ffi/dart/native/Cargo.toml +++ b/payjoin-ffi/dart/native/Cargo.toml @@ -17,8 +17,6 @@ crate-type = ["staticlib", "cdylib"] [dependencies] payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", branch = "master", features = ["dart"] } -# pinned version for MSRV 1.85 compatibility -home = "=0.5.11" [patch."https://github.com/payjoin/rust-payjoin.git"] payjoin-ffi = { path = "../.." } diff --git a/payjoin-test-utils/Cargo.toml b/payjoin-test-utils/Cargo.toml index a2b5d2233..8cf354c88 100644 --- a/payjoin-test-utils/Cargo.toml +++ b/payjoin-test-utils/Cargo.toml @@ -12,7 +12,6 @@ license = "MIT" bitcoin = { version = "0.32.7", features = ["base64"] } corepc-node = { version = "0.10.0", features = ["download", "29_0"] } http = "1.3.1" -log = "0.4.27" ohttp = { package = "bitcoin-ohttp", version = "0.6.0" } ohttp-relay = { version = "0.0.11", features = ["_test-util"] } once_cell = "1.21.3"