diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index b276ccca1..865bdd95e 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -115,9 +115,9 @@ checksum = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" [[package]] name = "anyhow" -version = "1.0.99" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arbitrary" @@ -426,6 +426,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + [[package]] name = "basic-toml" version = "0.1.1" @@ -644,17 +650,34 @@ dependencies = [ "percent-encoding-rfc3986", ] +[[package]] +name = "bitcoind" +version = "0.43.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210a8c06a273474440b1d9d3e87ca192cf2fe610797b11331ebecbfd9cf65725" +dependencies = [ + "anyhow", + "bitcoin_hashes 0.13.0", + "bitreq", + "corepc-regtest-client", + "log", + "serde_json", + "tempfile", + "which", +] + [[package]] name = "bitcoind-async-client" -version = "0.14.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfef338cdb79b56b6ef8133a8b18058d8b64e057164674a0ff41199b5cd44de" +checksum = "65f058c9de47d1114dc3a5672280884244d0e0d3688b01046eeaad1c25662209" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bitcoin", - "bitreq 0.3.5", - "corepc-types 0.13.0", + "bitreq", + "corepc-types", "hex-conservative 0.2.2", + "libc", "secp256k1", "serde", "serde_json", @@ -680,22 +703,14 @@ dependencies = [ [[package]] name = "bitreq" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c84f27ed293cb5218ab015faad9fbb95cf7905865ce71df075c8805a0b33b71" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "bitreq" -version = "0.3.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df90cd78f0510165fd370574676aeb57dbec0ee3bfff68645bb7b0e9a65dbd5" +checksum = "dd5a7b68e617647b750d9014ddcc82d009264afb70e0484bc99d9664506840b6" dependencies = [ "rustls", "rustls-webpki", + "serde", + "serde_json", "tokio", "tokio-rustls", "webpki-roots", @@ -728,27 +743,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" -[[package]] -name = "bzip2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "camino" version = "1.0.8" @@ -808,9 +802,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" +checksum = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" [[package]] name = "cfg-if" @@ -998,54 +992,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] -name = "corepc-client" -version = "0.12.0" +name = "corepc-regtest-client" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0d0096927a820ea80d4a43a2355209d9a69ef5b420861bf413c7e667cbff0b" +checksum = "2d31c915f51a65d3fb5f07732e385a4a3a33804c449a98041ae62fa354048233" dependencies = [ "bitcoin", - "corepc-types 0.12.0", + "corepc-types", "jsonrpc", "log", "serde", "serde_json", ] -[[package]] -name = "corepc-node" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8749105873c391b77fc943b7fdf8c05b6c1d06f6e71c6d2746ee7f8bda0072" -dependencies = [ - "anyhow", - "bitcoin_hashes 0.13.0", - "bitreq 0.3.5", - "corepc-client", - "flate2", - "log", - "serde_json", - "tar", - "tempfile", - "which", - "zip", -] - -[[package]] -name = "corepc-types" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583872320eb2ac629c36753023fd072f1ca1b3b74b20cc62bab055b54278789" -dependencies = [ - "bitcoin", - "serde", - "serde_json", -] - [[package]] name = "corepc-types" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96c7869aa8234d10a41cbe3a1697bcb3a2482c48d9eb3541b3a4014a81afdad" +checksum = "6fa32f494e25aa816dc5adfed14374676765deb0914b8fe8dfb63058866cce86" dependencies = [ "bitcoin", "serde", @@ -1063,21 +1027,11 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if 1.0.0", - "lazy_static", + "cfg-if 0.1.0", ] [[package]] @@ -1872,12 +1826,12 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629d2b4ae586d04b6bae3c75879d7ddd39325c2b67a9c87634f4ec88a488dc65" +checksum = "6802a88c69545937a980fcc973543364aa948d7a7c0f258eb8713a7781248f1c" dependencies = [ "base64 0.22.1", - "bitreq 0.2.0", + "bitreq", "serde", "serde_json", ] @@ -1900,9 +1854,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.183" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libfuzzer-sys" @@ -2457,7 +2411,7 @@ dependencies = [ "axum-server", "bitcoin", "bitcoin-ohttp", - "corepc-node", + "bitcoind", "futures", "http", "once_cell", @@ -3029,9 +2983,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.38" +version = "0.23.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "once_cell", "ring", @@ -3075,9 +3029,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.13" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -4401,11 +4355,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35" dependencies = [ - "cfg-if 0.1.9", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -4465,9 +4419,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" +checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9" dependencies = [ "rustls-pki-types", ] @@ -4940,19 +4894,6 @@ dependencies = [ "synstructure 0.12.2", ] -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "bzip2", - "crc32fast", - "crossbeam-utils", - "flate2", -] - [[package]] name = "zmij" version = "1.0.0" diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 758cb3587..4a99d69c6 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -634,17 +634,34 @@ dependencies = [ "percent-encoding-rfc3986", ] +[[package]] +name = "bitcoind" +version = "0.43.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210a8c06a273474440b1d9d3e87ca192cf2fe610797b11331ebecbfd9cf65725" +dependencies = [ + "anyhow", + "bitcoin_hashes", + "bitreq", + "corepc-regtest-client", + "log", + "serde_json", + "tempfile", + "which", +] + [[package]] name = "bitcoind-async-client" -version = "0.14.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbfef338cdb79b56b6ef8133a8b18058d8b64e057164674a0ff41199b5cd44de" +checksum = "65f058c9de47d1114dc3a5672280884244d0e0d3688b01046eeaad1c25662209" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bitcoin", - "bitreq 0.3.7", - "corepc-types 0.13.0", + "bitreq", + "corepc-types", "hex-conservative 0.2.3", + "libc", "secp256k1", "serde", "serde_json", @@ -670,22 +687,14 @@ dependencies = [ [[package]] name = "bitreq" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c84f27ed293cb5218ab015faad9fbb95cf7905865ce71df075c8805a0b33b71" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "bitreq" -version = "0.3.7" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65c2e1ab98050c93cc9ada070d5070e014329c65196d03f6f8f1f75c2666f37" +checksum = "dd5a7b68e617647b750d9014ddcc82d009264afb70e0484bc99d9664506840b6" dependencies = [ "rustls", "rustls-webpki", + "serde", + "serde_json", "tokio", "tokio-rustls", "webpki-roots", @@ -718,26 +727,6 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "camino" version = "1.2.6" @@ -1007,54 +996,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "corepc-client" -version = "0.12.0" +name = "corepc-regtest-client" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0d0096927a820ea80d4a43a2355209d9a69ef5b420861bf413c7e667cbff0b" +checksum = "2d31c915f51a65d3fb5f07732e385a4a3a33804c449a98041ae62fa354048233" dependencies = [ "bitcoin", - "corepc-types 0.12.0", + "corepc-types", "jsonrpc", "log", "serde", "serde_json", ] -[[package]] -name = "corepc-node" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8749105873c391b77fc943b7fdf8c05b6c1d06f6e71c6d2746ee7f8bda0072" -dependencies = [ - "anyhow", - "bitcoin_hashes", - "bitreq 0.3.7", - "corepc-client", - "flate2", - "log", - "serde_json", - "tar", - "tempfile", - "which", - "zip", -] - [[package]] name = "corepc-types" -version = "0.12.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583872320eb2ac629c36753023fd072f1ca1b3b74b20cc62bab055b54278789" -dependencies = [ - "bitcoin", - "serde", - "serde_json", -] - -[[package]] -name = "corepc-types" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96c7869aa8234d10a41cbe3a1697bcb3a2482c48d9eb3541b3a4014a81afdad" +checksum = "6fa32f494e25aa816dc5adfed14374676765deb0914b8fe8dfb63058866cce86" dependencies = [ "bitcoin", "serde", @@ -1088,12 +1047,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-utils" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" - [[package]] name = "crunchy" version = "0.2.4" @@ -2080,12 +2033,12 @@ dependencies = [ [[package]] name = "jsonrpc" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629d2b4ae586d04b6bae3c75879d7ddd39325c2b67a9c87634f4ec88a488dc65" +checksum = "6802a88c69545937a980fcc973543364aa948d7a7c0f258eb8713a7781248f1c" dependencies = [ "base64 0.22.1", - "bitreq 0.2.0", + "bitreq", "serde", "serde_json", ] @@ -2657,7 +2610,7 @@ dependencies = [ "axum-server", "bitcoin", "bitcoin-ohttp", - "corepc-node", + "bitcoind", "futures", "http", "once_cell", @@ -3390,9 +3343,9 @@ checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" [[package]] name = "rustls-webpki" -version = "0.103.15" +version = "0.103.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" dependencies = [ "ring", "rustls-pki-types", @@ -4814,9 +4767,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9" dependencies = [ "rustls-pki-types", ] @@ -5206,19 +5159,6 @@ dependencies = [ "syn 3.0.9", ] -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "bzip2", - "crc32fast", - "crossbeam-utils", - "flate2", -] - [[package]] name = "zlib-rs" version = "0.6.8" diff --git a/payjoin-cli/Cargo.toml b/payjoin-cli/Cargo.toml index 3d8f727b6..a35391de4 100644 --- a/payjoin-cli/Cargo.toml +++ b/payjoin-cli/Cargo.toml @@ -25,9 +25,9 @@ v2 = ["payjoin/v2", "payjoin/io"] [dependencies] ahash = "0.7.8" -anyhow = "1.0.99" +anyhow = "1.0.103" async-trait = "0.1.89" -bitcoind-async-client = "0.14.0" +bitcoind-async-client = "0.16.1" clap = { version = "4.5.45", features = ["derive"] } config = "0.15.17" dirs = "6.0.0" diff --git a/payjoin-ffi/CHANGELOG.md b/payjoin-ffi/CHANGELOG.md index 62fe69e10..d3c1fa5fb 100644 --- a/payjoin-ffi/CHANGELOG.md +++ b/payjoin-ffi/CHANGELOG.md @@ -8,6 +8,7 @@ - Dart: the package ships the `native/Cargo.lock` it was released with and the build hook builds it with `--locked`, so every build compiles the dependency versions CI tested. +- corepc-node dep replaced with bitcoind re-exported through payjoin-test-utils ## [0.25.0] diff --git a/payjoin-ffi/javascript/test-utils/src/lib.rs b/payjoin-ffi/javascript/test-utils/src/lib.rs index b760472bf..ace440356 100644 --- a/payjoin-ffi/javascript/test-utils/src/lib.rs +++ b/payjoin-ffi/javascript/test-utils/src/lib.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use napi::bindgen_prelude::*; use napi_derive::napi; -use payjoin_test_utils::corepc_node::AddressType; +use payjoin_test_utils::bitcoind::AddressType; use serde_json::Value; #[napi] @@ -32,13 +32,13 @@ impl BitcoindEnv { #[napi] #[derive(Clone)] pub struct BitcoindInstance { - _inner: Arc, + _inner: Arc, } #[napi] #[derive(Clone)] pub struct RpcClient { - inner: Arc, + inner: Arc, } #[napi] diff --git a/payjoin-ffi/kotlin/CONTRIBUTING.md b/payjoin-ffi/kotlin/CONTRIBUTING.md index 8ba9abe8f..d5f3ff6c7 100644 --- a/payjoin-ffi/kotlin/CONTRIBUTING.md +++ b/payjoin-ffi/kotlin/CONTRIBUTING.md @@ -25,5 +25,4 @@ Protocol `close` is renamed to `closeSession` only in `[bindings.kotlin.rename]` With nix, `nix develop .#kotlin` provides the pinned MSRV Rust toolchain, JDK 21, and `BITCOIND_EXE` (via `nixpkgs`, with `BITCOIND_SKIP_DOWNLOAD=1`), and is what CI uses. Without -nix, install Python 3 for binding generation and use a local JDK 21+ and the Gradle wrapper; -`corepc-node` will download `bitcoind` on first test run. +nix, install Python 3 for binding generation and use a local JDK 21+ and the Gradle wrapper. diff --git a/payjoin-ffi/kotlin/README.md b/payjoin-ffi/kotlin/README.md index d3bb5deee..b0317502b 100644 --- a/payjoin-ffi/kotlin/README.md +++ b/payjoin-ffi/kotlin/README.md @@ -20,7 +20,7 @@ Or `bash ./contrib/test.sh` from this directory (uses `Cargo-recent.lock`). `./gradlew test` includes a v2↔v2 integration test that starts a local payjoin directory, OHTTP relay, and bitcoind. Inside the nix `.#kotlin` shell, `BITCOIND_EXE` points at the nixpkgs `bitcoind` and `BITCOIND_SKIP_DOWNLOAD=1` is set, so no download happens. Outside the nix shell, -Bitcoin Core is downloaded by corepc-node (`29_0`) on first run instead. +Bitcoin Core is downloaded by bitcoind (`29_0`) on first run instead. Without nix: Rust (see repo `rust-toolchain.toml` / MSRV 1.85), JDK 21+, Python 3, and the Gradle wrapper in this directory. Python parses Cargo's native library output during generation. Network access is required the first time bitcoind is fetched. diff --git a/payjoin-ffi/src/test_utils.rs b/payjoin-ffi/src/test_utils.rs index a577dc7ea..6c0450dbf 100644 --- a/payjoin-ffi/src/test_utils.rs +++ b/payjoin-ffi/src/test_utils.rs @@ -2,9 +2,9 @@ use std::io; use std::sync::Arc; use lazy_static::lazy_static; -use payjoin_test_utils::corepc_node::AddressType; +use payjoin_test_utils::bitcoind::AddressType; use payjoin_test_utils::{ - corepc_node, EXAMPLE_URL, INVALID_PSBT, ORIGINAL_PSBT, PAYJOIN_PROPOSAL, + bitcoind, EXAMPLE_URL, INVALID_PSBT, ORIGINAL_PSBT, PAYJOIN_PROPOSAL, PAYJOIN_PROPOSAL_WITH_SENDER_INFO, QUERY_PARAMS, RECEIVER_INPUT_CONTRIBUTION, }; use serde_json::Value; @@ -34,12 +34,12 @@ impl BitcoindEnv { #[derive(uniffi::Object)] pub struct BitcoindInstance { - _inner: corepc_node::Node, + _inner: bitcoind::BitcoinD, } #[derive(uniffi::Object)] pub struct RpcClient { - inner: corepc_node::Client, + inner: bitcoind::Client, } #[uniffi::export] diff --git a/payjoin-mailroom/Cargo.toml b/payjoin-mailroom/Cargo.toml index d0bfdcd66..a040f6cf0 100644 --- a/payjoin-mailroom/Cargo.toml +++ b/payjoin-mailroom/Cargo.toml @@ -28,7 +28,7 @@ telemetry = [ ] [dependencies] -anyhow = "1.0.99" +anyhow = "1.0.103" async-trait = { version = "0.1.89", optional = true } axum = { version = "0.8", features = ["http2"] } axum-server = { version = "0.8", features = [ @@ -73,7 +73,7 @@ rand = "0.8" reqwest = { version = "0.12.23", default-features = false, features = [ "rustls-tls", ], optional = true } -rustls = { version = "0.23.38", default-features = false, features = [ +rustls = { version = "0.23.46", default-features = false, features = [ "ring", ], optional = true } serde = { version = "1.0.228", features = ["derive"] } diff --git a/payjoin-test-utils/CHANGELOG.md b/payjoin-test-utils/CHANGELOG.md index 378dab084..9fbc8ecff 100644 --- a/payjoin-test-utils/CHANGELOG.md +++ b/payjoin-test-utils/CHANGELOG.md @@ -8,6 +8,7 @@ - Specify the versions for deps more precisely in the cargo toml [#696](https://github.com/payjoin/rust-payjoin/pull/696) - Extend tests for rest of receive module [#632](https://github.com/payjoin/rust-payjoin/pull/632) - Fix uninline format clippy violations [#667](https://github.com/payjoin/rust-payjoin/pull/667) +- Replace corepc-node with bitcoind ## 0.0.0 diff --git a/payjoin-test-utils/Cargo.toml b/payjoin-test-utils/Cargo.toml index 932cf779b..dc9dd4d5a 100644 --- a/payjoin-test-utils/Cargo.toml +++ b/payjoin-test-utils/Cargo.toml @@ -27,7 +27,7 @@ axum-server = { version = "0.8", features = [ "tls-rustls-no-provider", ], optional = true } bitcoin = { version = "0.32.102", features = ["base64"] } -corepc-node = { version = "0.12.0", features = ["download", "29_0"] } +bitcoind = { version = "0.43.2", features = ["29_0", "download"] } futures = { version = "0.3.21", default-features = false, features = ["std"] } http = { version = "1.3.1", optional = true } ohttp = { package = "bitcoin-ohttp", version = "0.7.0", optional = true } @@ -38,7 +38,7 @@ rcgen = { version = "0.14.7", optional = true } reqwest = { version = "0.12.23", default-features = false, features = [ "rustls-tls", ], optional = true } -rustls = { version = "0.23.38", default-features = false, features = [ +rustls = { version = "0.23.46", default-features = false, features = [ "ring", ], optional = true } tar = "0.4.9" diff --git a/payjoin-test-utils/src/lib.rs b/payjoin-test-utils/src/lib.rs index a9579d7bd..a85573e28 100644 --- a/payjoin-test-utils/src/lib.rs +++ b/payjoin-test-utils/src/lib.rs @@ -2,8 +2,8 @@ use std::result::Result; use std::str::FromStr; use bitcoin::{Amount, Psbt}; -pub use corepc_node; // re-export for convenience -use corepc_node::AddressType; +pub use bitcoind; // re-export for convenience +use bitcoind::AddressType; use once_cell::sync::{Lazy, OnceCell}; use tracing::Level; use tracing_subscriber::{EnvFilter, FmtSubscriber}; @@ -30,19 +30,19 @@ pub fn init_tracing() { }); } -pub fn init_bitcoind() -> Result { - let bitcoind_exe = corepc_node::exe_path()?; - let mut conf = corepc_node::Conf::default(); +pub fn init_bitcoind() -> Result { + let bitcoind_exe = bitcoind::exe_path()?; + let mut conf = bitcoind::Conf::default(); conf.view_stdout = tracing::enabled!(target: "corepc", Level::TRACE); // conf.args.push("-txindex"); - let bitcoind = corepc_node::Node::with_conf(bitcoind_exe, &conf)?; + let bitcoind = bitcoind::BitcoinD::with_conf(bitcoind_exe, &conf)?; Ok(bitcoind) } pub fn init_bitcoind_sender_receiver( sender_address_type: Option, receiver_address_type: Option, -) -> Result<(corepc_node::Node, corepc_node::Client, corepc_node::Client), BoxError> { +) -> Result<(bitcoind::BitcoinD, bitcoind::Client, bitcoind::Client), BoxError> { let bitcoind = init_bitcoind()?; let mut wallets = create_and_fund_wallets( &bitcoind, @@ -55,9 +55,9 @@ pub fn init_bitcoind_sender_receiver( } fn create_and_fund_wallets>( - bitcoind: &corepc_node::Node, + bitcoind: &bitcoind::BitcoinD, wallets: Vec<(W, Option)>, -) -> Result, BoxError> { +) -> Result, BoxError> { let mut funded_wallets = vec![]; let funding_wallet = bitcoind.create_wallet("funding_wallet")?; let funding_address = funding_wallet.new_address()?; @@ -86,7 +86,7 @@ fn create_and_fund_wallets>( pub fn init_bitcoind_multi_sender_single_receiver( number_of_senders: usize, -) -> Result<(corepc_node::Node, Vec, corepc_node::Client), BoxError> { +) -> Result<(bitcoind::BitcoinD, Vec, bitcoind::Client), BoxError> { let bitcoind = init_bitcoind()?; let wallets_to_create = (0..number_of_senders + 1).map(|i| (format!("sender_{i}"), None)).collect::>(); diff --git a/payjoin/Cargo.toml b/payjoin/Cargo.toml index bd54137b0..b060c869b 100644 --- a/payjoin/Cargo.toml +++ b/payjoin/Cargo.toml @@ -51,7 +51,7 @@ http = { version = "1.3.1", optional = true } ohttp = { package = "bitcoin-ohttp", version = "0.7.0", optional = true } percent-encoding-rfc3986 = { version = "0.1.3", optional = true } reqwest = { version = "0.12.23", default-features = false, optional = true } -rustls = { version = "0.23.38", optional = true, default-features = false, features = [ +rustls = { version = "0.23.46", optional = true, default-features = false, features = [ "ring", ] } serde = { version = "1.0.228", default-features = false, optional = true } diff --git a/payjoin/tests/integration.rs b/payjoin/tests/integration.rs index 2b67a4ce9..889528645 100644 --- a/payjoin/tests/integration.rs +++ b/payjoin/tests/integration.rs @@ -15,9 +15,9 @@ mod integration { use payjoin::{ImplementationError, PjUri, Request, Uri}; #[cfg(feature = "v1")] use payjoin::{OutputSubstitution, Url}; - use payjoin_test_utils::corepc_node::vtype::ListUnspentItem; - use payjoin_test_utils::corepc_node::AddressType; - use payjoin_test_utils::{corepc_node, init_bitcoind_sender_receiver, init_tracing, BoxError}; + use payjoin_test_utils::bitcoind::vtype::ListUnspentItem; + use payjoin_test_utils::bitcoind::AddressType; + use payjoin_test_utils::{bitcoind, init_bitcoind_sender_receiver, init_tracing, BoxError}; use serde_json::json; #[cfg(feature = "v1")] @@ -102,8 +102,8 @@ mod integration { } fn do_v1_to_v1( - sender: corepc_node::Client, - receiver: corepc_node::Client, + sender: bitcoind::Client, + receiver: bitcoind::Client, expected_weight: Weight, ) -> Result<(), BoxError> { // Receiver creates the payjoin URI @@ -801,8 +801,8 @@ mod integration { /// how the receiver is going to validate the action the sender takes. async fn do_v2_to_v2( services: &TestServices, - receiver: &corepc_node::Client, - sender: &corepc_node::Client, + receiver: &bitcoind::Client, + sender: &bitcoind::Client, recv_persister: &R, send_persister: &S, sender_final_action: SenderFinalAction, @@ -1051,7 +1051,7 @@ mod integration { // ********************** // Inside the Receiver: let agent_clone: Arc = agent.clone(); - let receiver: Arc = Arc::new(receiver); + let receiver: Arc = Arc::new(receiver); let receiver_clone = receiver.clone(); let ohttp_relay = services.ohttp_relay_url().to_string(); let receiver_loop = tokio::task::spawn(async move { @@ -1145,7 +1145,7 @@ mod integration { } fn handle_directory_proposal( - receiver: &corepc_node::Client, + receiver: &bitcoind::Client, proposal: Receiver, recv_persister: &impl SessionPersister, custom_inputs: Option>, @@ -1239,7 +1239,7 @@ mod integration { .finalize_proposal(|psbt: &Psbt| { receiver // call RPC manually to pass custom options - .call::( + .call::( "walletprocesspsbt", &[ json!(psbt.to_string()), @@ -1256,7 +1256,7 @@ mod integration { } pub fn build_sweep_psbt( - sender: &corepc_node::Client, + sender: &bitcoind::Client, pj_uri: &PjUri, ) -> Result { let mut outputs = HashMap::with_capacity(1); @@ -1270,7 +1270,7 @@ mod integration { }); let psbt = sender // call RPC manually to pass custom options - .call::( + .call::( "walletcreatefundedpsbt", &[ json!(&[] as &[serde_json::Value]), // inputs @@ -1473,7 +1473,7 @@ mod integration { } } - fn build_original_psbt(sender: &corepc_node::Client, pj_uri: &PjUri) -> Result { + fn build_original_psbt(sender: &bitcoind::Client, pj_uri: &PjUri) -> Result { let mut outputs = HashMap::with_capacity(1); outputs.insert( pj_uri.address().to_string(), @@ -1487,7 +1487,7 @@ mod integration { }); let psbt = sender // call RPC manually to pass custom options - .call::( + .call::( "walletcreatefundedpsbt", &[ json!(&[] as &[serde_json::Value]), // inputs @@ -1508,7 +1508,7 @@ mod integration { fn handle_v1_pj_request( req: Request, headers: impl payjoin::receive::v1::Headers, - receiver: &corepc_node::Client, + receiver: &bitcoind::Client, custom_outputs: Option>, drain_script: Option<&bitcoin::Script>, custom_inputs: Option>, @@ -1529,7 +1529,7 @@ mod integration { #[cfg(feature = "v1")] fn handle_proposal( proposal: payjoin::receive::v1::UncheckedOriginalPayload, - receiver: &corepc_node::Client, + receiver: &bitcoind::Client, custom_outputs: Option>, drain_script: Option<&bitcoin::Script>, custom_inputs: Option>, @@ -1608,7 +1608,7 @@ mod integration { let payjoin_proposal = payjoin.finalize_proposal(|psbt: &Psbt| { receiver // call RPC manually to pass custom options - .call::( + .call::( "walletprocesspsbt", &[ json!(psbt.to_string()), @@ -1624,7 +1624,7 @@ mod integration { } fn extract_pj_tx( - sender: &corepc_node::Client, + sender: &bitcoind::Client, psbt: Psbt, ) -> Result> { let payjoin_psbt = sender.wallet_process_psbt(&psbt)?.psbt; @@ -1646,7 +1646,7 @@ mod integration { // witness_utxo, even for non-witness inputs witness_utxo: Some(TxOut { value: utxo.amount, script_pubkey: utxo.script_pubkey }), redeem_script: utxo.redeem_script, - //FIXME needs later corepc_node bitcoin version + //FIXME needs later bitcoind bitcoin version //witness_script: utxo.witness_script.clone(), ..Default::default() };