Skip to content

Commit 4ef980d

Browse files
committed
Depend on bitreq
We just forked `minreq` into this repository to create an HTTP crate that is specifically designed to be used by Bitcoin projects. As such we called it `bitreq`. Depend on the local `bitreq` crate instead of `minreq`. Done directly in `node` and `jsonrpc`. Indirectly in `client`, including rename of a million macros that have `minreq` in the name.
1 parent 1998fed commit 4ef980d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+108
-138
lines changed

Cargo-minimal.lock

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ version = "0.10.0"
279279
dependencies = [
280280
"anyhow",
281281
"bitcoin_hashes",
282+
"bitreq",
282283
"corepc-client",
283284
"env_logger",
284285
"flate2",
285286
"log",
286-
"minreq",
287287
"serde_json",
288288
"tar",
289289
"tempfile",
@@ -451,7 +451,7 @@ name = "jsonrpc"
451451
version = "0.18.0"
452452
dependencies = [
453453
"base64 0.22.1",
454-
"minreq",
454+
"bitreq",
455455
"serde",
456456
"serde_json",
457457
"socks",
@@ -501,21 +501,6 @@ dependencies = [
501501
"adler2",
502502
]
503503

504-
[[package]]
505-
name = "minreq"
506-
version = "2.11.2"
507-
source = "registry+https://github.com/rust-lang/crates.io-index"
508-
checksum = "6fdef521c74c2884a4f3570bcdb6d2a77b3c533feb6b27ac2ae72673cc221c64"
509-
dependencies = [
510-
"log",
511-
"once_cell",
512-
"rustls",
513-
"rustls-webpki",
514-
"serde",
515-
"serde_json",
516-
"webpki-roots",
517-
]
518-
519504
[[package]]
520505
name = "mio"
521506
version = "1.0.2"

Cargo-recent.lock

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ version = "0.10.0"
279279
dependencies = [
280280
"anyhow",
281281
"bitcoin_hashes",
282+
"bitreq",
282283
"corepc-client",
283284
"env_logger",
284285
"flate2",
285286
"log",
286-
"minreq",
287287
"serde_json",
288288
"tar",
289289
"tempfile",
@@ -456,7 +456,7 @@ name = "jsonrpc"
456456
version = "0.18.0"
457457
dependencies = [
458458
"base64 0.22.1",
459-
"minreq",
459+
"bitreq",
460460
"serde",
461461
"serde_json",
462462
"socks",
@@ -506,21 +506,6 @@ dependencies = [
506506
"adler2",
507507
]
508508

509-
[[package]]
510-
name = "minreq"
511-
version = "2.13.2"
512-
source = "registry+https://github.com/rust-lang/crates.io-index"
513-
checksum = "da0c420feb01b9fb5061f8c8f452534361dd783756dcf38ec45191ce55e7a161"
514-
dependencies = [
515-
"log",
516-
"once_cell",
517-
"rustls",
518-
"rustls-webpki",
519-
"serde",
520-
"serde_json",
521-
"webpki-roots",
522-
]
523-
524509
[[package]]
525510
name = "mio"
526511
version = "1.1.0"

client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ serde = { version = "1.0.103", default-features = false, features = [ "derive",
2727
serde_json = { version = "1.0.117" }
2828
types = { package = "corepc-types", version = "0.10.0", path = "../types", default-features = false, features = ["std"] }
2929

30-
jsonrpc = { version = "0.18.0", path = "../jsonrpc", features = ["minreq_http"], optional = true }
30+
jsonrpc = { version = "0.18.0", path = "../jsonrpc", features = ["bitreq_http"], optional = true }
3131

3232
[dev-dependencies]

client/src/client_sync/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ impl Auth {
5555
}
5656
}
5757

58-
/// Defines a `jsonrpc::Client` using `minreq`.
58+
/// Defines a `jsonrpc::Client` using `bitreq`.
5959
#[macro_export]
60-
macro_rules! define_jsonrpc_minreq_client {
60+
macro_rules! define_jsonrpc_bitreq_client {
6161
($version:literal) => {
6262
use std::fmt;
6363

@@ -81,7 +81,7 @@ macro_rules! define_jsonrpc_minreq_client {
8181
impl Client {
8282
/// Creates a client to a bitcoind JSON-RPC server without authentication.
8383
pub fn new(url: &str) -> Self {
84-
let transport = jsonrpc::http::minreq_http::Builder::new()
84+
let transport = jsonrpc::http::bitreq_http::Builder::new()
8585
.url(url)
8686
.expect("jsonrpc v0.18, this function does not error")
8787
.timeout(std::time::Duration::from_secs(60))
@@ -98,7 +98,7 @@ macro_rules! define_jsonrpc_minreq_client {
9898
}
9999
let (user, pass) = auth.get_user_pass()?;
100100

101-
let transport = jsonrpc::http::minreq_http::Builder::new()
101+
let transport = jsonrpc::http::bitreq_http::Builder::new()
102102
.url(url)
103103
.expect("jsonrpc v0.18, this function does not error")
104104
.timeout(std::time::Duration::from_secs(60))

client/src/client_sync/v17/blockchain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! All macros require `Client` to be in scope.
99
//!
10-
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
10+
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
1111
1212
/// Implements Bitcoin Core JSON-RPC API method `getblockchaininfo`.
1313
#[macro_export]

client/src/client_sync/v17/control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! All macros require `Client` to be in scope.
99
//!
10-
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
10+
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
1111
1212
/// Implements Bitcoin Core JSON-RPC API method `getmemoryinfo`.
1313
#[macro_export]

client/src/client_sync/v17/generating.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! All macros require `Client` to be in scope.
99
//!
10-
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
10+
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
1111
1212
/// Implements Bitcoin Core JSON-RPC API method `generatetoaddress`.
1313
#[macro_export]

client/src/client_sync/v17/mining.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! All macros require `Client` to be in scope.
99
//!
10-
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
10+
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
1111
1212
/// Implements Bitcoin Core JSON-RPC API method `getblocktemplate`.
1313
#[macro_export]

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use serde::{Deserialize, Serialize, Serializer};
2525
use crate::client_sync::into_json;
2626
use crate::types::v17::*;
2727

28-
crate::define_jsonrpc_minreq_client!("v17");
28+
crate::define_jsonrpc_bitreq_client!("v17");
2929
crate::impl_client_check_expected_server_version!({ [170200] });
3030

3131
// == Blockchain ==

client/src/client_sync/v17/network.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! Specifically this is methods found under the `== Network ==` section of the
88
//! API docs of Bitcoin Core `v0.17`.
99
//!
10-
//! See, or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
10+
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
1111
1212
/// Implements Bitcoin Core JSON-RPC API method `addnode`.
1313
#[macro_export]

0 commit comments

Comments
 (0)