Skip to content

Commit 2ea4b01

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 d7a6089 commit 2ea4b01

Some content is hidden

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

64 files changed

+105
-104
lines changed

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
@@ -24,7 +24,7 @@ use serde::{Deserialize, Serialize, Serializer};
2424
use crate::client_sync::into_json;
2525
use crate::types::v17::*;
2626

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

3030
// == 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]

client/src/client_sync/v17/raw_transactions.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 `combinepsbt`.
1313
#[macro_export]

client/src/client_sync/v17/util.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 `createmultisig`.
1313
#[macro_export]

0 commit comments

Comments
 (0)