Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cron-daily-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# We only get 20 jobs at a time, we probably don't want to go
# over that limit with fuzzing because of the hour run time.
fuzz_target: [
minreq_http,
bitreq_http,
simple_http,
]
steps:
Expand Down
19 changes: 2 additions & 17 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ version = "0.10.0"
dependencies = [
"anyhow",
"bitcoin_hashes",
"bitreq",
"corepc-client",
"env_logger",
"flate2",
"log",
"minreq",
"serde_json",
"tar",
"tempfile",
Expand Down Expand Up @@ -451,7 +451,7 @@ name = "jsonrpc"
version = "0.18.0"
dependencies = [
"base64 0.22.1",
"minreq",
"bitreq",
"serde",
"serde_json",
"socks",
Expand Down Expand Up @@ -501,21 +501,6 @@ dependencies = [
"adler2",
]

[[package]]
name = "minreq"
version = "2.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fdef521c74c2884a4f3570bcdb6d2a77b3c533feb6b27ac2ae72673cc221c64"
dependencies = [
"log",
"once_cell",
"rustls",
"rustls-webpki",
"serde",
"serde_json",
"webpki-roots",
]

[[package]]
name = "mio"
version = "1.0.2"
Expand Down
19 changes: 2 additions & 17 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ version = "0.10.0"
dependencies = [
"anyhow",
"bitcoin_hashes",
"bitreq",
"corepc-client",
"env_logger",
"flate2",
"log",
"minreq",
"serde_json",
"tar",
"tempfile",
Expand Down Expand Up @@ -456,7 +456,7 @@ name = "jsonrpc"
version = "0.18.0"
dependencies = [
"base64 0.22.1",
"minreq",
"bitreq",
"serde",
"serde_json",
"socks",
Expand Down Expand Up @@ -506,21 +506,6 @@ dependencies = [
"adler2",
]

[[package]]
name = "minreq"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da0c420feb01b9fb5061f8c8f452534361dd783756dcf38ec45191ce55e7a161"
dependencies = [
"log",
"once_cell",
"rustls",
"rustls-webpki",
"serde",
"serde_json",
"webpki-roots",
]

[[package]]
name = "mio"
version = "1.1.0"
Expand Down
4 changes: 2 additions & 2 deletions bitreq/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub struct AsyncConnection {
impl AsyncConnection {
/// Creates a new `AsyncConnection`.
pub(crate) fn new(request: ParsedRequest) -> AsyncConnection {
let timeout = request.config.timeout.or_else(|| match env::var("MINREQ_TIMEOUT") {
let timeout = request.config.timeout.or_else(|| match env::var("BITREQ_TIMEOUT") {
Ok(t) => t.parse::<u64>().ok(),
Err(_) => None,
});
Expand Down Expand Up @@ -128,7 +128,7 @@ impl Connection {
/// Creates a new `Connection`. See [Request] and [ParsedRequest]
/// for specifics about *what* is being sent.
pub(crate) fn new(request: ParsedRequest) -> Connection {
let timeout = request.config.timeout.or_else(|| match env::var("MINREQ_TIMEOUT") {
let timeout = request.config.timeout.or_else(|| match env::var("BITREQ_TIMEOUT") {
Ok(t) => t.parse::<u64>().ok(),
Err(_) => None,
});
Expand Down
8 changes: 4 additions & 4 deletions bitreq/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # Minreq
//! # Bitreq
//!
//! Simple, minimal-dependency HTTP client. The library has a very
//! minimal API, so you'll probably know everything you need to after
Expand Down Expand Up @@ -207,16 +207,16 @@
//! ```text,ignore
//! bitreq::get("/").with_timeout(8).send();
//! ```
//! - Set the environment variable `MINREQ_TIMEOUT` to the desired
//! - Set the environment variable `BITREQ_TIMEOUT` to the desired
//! amount of seconds until timeout. Ie. if you have a program called
//! `foo` that uses bitreq, and you want all the requests made by that
//! program to timeout in 8 seconds, you launch the program like so:
//! ```text,ignore
//! $ MINREQ_TIMEOUT=8 ./foo
//! $ BITREQ_TIMEOUT=8 ./foo
//! ```
//! Or add the following somewhere before the requests in the code.
//! ```
//! std::env::set_var("MINREQ_TIMEOUT", "8");
//! std::env::set_var("BITREQ_TIMEOUT", "8");
//! ```
//! If the timeout is set with `with_timeout`, the environment
//! variable will be ignored.
Expand Down
2 changes: 1 addition & 1 deletion bitreq/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl Request {
/// Returns `Err` if we run into an error while sending the
/// request, or receiving/parsing the response. The specific error
/// is described in the `Err`, and it can be any
/// [`minreq::Error`](enum.Error.html) except
/// [`bitreq::Error`](enum.Error.html) except
/// [`InvalidUtf8InBody`](enum.Error.html#variant.InvalidUtf8InBody).
#[cfg(feature = "async")]
pub async fn send_async(self) -> Result<Response, Error> {
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ serde = { version = "1.0.103", default-features = false, features = [ "derive",
serde_json = { version = "1.0.117" }
types = { package = "corepc-types", version = "0.10.0", path = "../types", default-features = false, features = ["std"] }

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

[dev-dependencies]
8 changes: 4 additions & 4 deletions client/src/client_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ impl Auth {
}
}

/// Defines a `jsonrpc::Client` using `minreq`.
/// Defines a `jsonrpc::Client` using `bitreq`.
#[macro_export]
macro_rules! define_jsonrpc_minreq_client {
macro_rules! define_jsonrpc_bitreq_client {
($version:literal) => {
use std::fmt;

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

let transport = jsonrpc::http::minreq_http::Builder::new()
let transport = jsonrpc::http::bitreq_http::Builder::new()
.url(url)
.expect("jsonrpc v0.18, this function does not error")
.timeout(std::time::Duration::from_secs(60))
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getblockchaininfo`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getmemoryinfo`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/generating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `generatetoaddress`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/hidden.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `waitforblock`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getblocktemplate`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use serde::{Deserialize, Serialize, Serializer};
use crate::client_sync::into_json;
use crate::types::v17::*;

crate::define_jsonrpc_minreq_client!("v17");
crate::define_jsonrpc_bitreq_client!("v17");
crate::impl_client_check_expected_server_version!({ [170200] });

// == Blockchain ==
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Specifically this is methods found under the `== Network ==` section of the
//! API docs of Bitcoin Core `v0.17`.
//!
//! See, or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `addnode`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/raw_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `combinepsbt`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `createmultisig`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `abandontransaction`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getrpcinfo`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `submitheader`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub use crate::client_sync::{
};

// This publicly re-exports `Client`.
crate::define_jsonrpc_minreq_client!("v18");
crate::define_jsonrpc_bitreq_client!("v18");
crate::impl_client_check_expected_server_version!({ [180100] });

// == Blockchain ==
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Specifically this is methods found under the `== Network ==` section of the
//! API docs of Bitcoin Core `v0.18`.
//!
//! See, or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See, or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getnodeaddresses`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/raw_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `analyzepsbt`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `deriveaddresses`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v18/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.
/// Implements Bitcoin Core JSON-RPC API method `getreceivedbylabel`.
#[macro_export]
macro_rules! impl_client_v18__get_received_by_label {
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v19/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getblockfilter`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v19/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub use crate::client_sync::{
},
};

crate::define_jsonrpc_minreq_client!("v19");
crate::define_jsonrpc_bitreq_client!("v19");
crate::impl_client_check_expected_server_version!({ [190100] });

// == Blockchain ==
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v19/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `getbalances`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v20/generating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `generatetodescriptor`.
#[macro_export]
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v20/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub use crate::client_sync::{
},
};

crate::define_jsonrpc_minreq_client!("v20");
crate::define_jsonrpc_bitreq_client!("v20");
crate::impl_client_check_expected_server_version!({ [200200] });

// == Blockchain ==
Expand Down
2 changes: 1 addition & 1 deletion client/src/client_sync/v21/generating.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! All macros require `Client` to be in scope.
//!
//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
//! See or use the `define_jsonrpc_bitreq_client!` macro to define a `Client`.

/// Implements Bitcoin Core JSON-RPC API method `generateblock`.
#[macro_export]
Expand Down
Loading