Skip to content

Commit 06526db

Browse files
committed
feat(client): Update json-rpc & switch to bitreq
- update json-rpc to v0.19.0 - switch from minreq_http to bitreq_http
1 parent 6ff6641 commit 06526db

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 30 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ readme = "README.md"
1313

1414
[dependencies]
1515
corepc-types = { version = "0.11.0", features = ["default"]}
16-
jsonrpc = { version = "0.18.0", features = ["simple_http", "simple_tcp", "minreq_http", "simple_uds", "proxy"] }
16+
jsonrpc = { version = "0.19.0", features = ["simple_http", "simple_tcp", "bitreq_http", "simple_uds", "proxy"] }
1717

1818
[features]
1919
default = ["30_0"]

src/client.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
};
66

77
use crate::error::Error;
8-
use crate::jsonrpc::minreq_http::Builder;
8+
use crate::jsonrpc::bitreq_http::Builder;
99
use corepc_types::{
1010
bitcoin::{
1111
block::Header, consensus::encode::deserialize_hex, Block, BlockHash, Transaction, Txid,
@@ -94,10 +94,8 @@ impl Client {
9494
}
9595
};
9696

97-
let transport = builder.build();
98-
9997
Ok(Self {
100-
inner: jsonrpc::Client::with_transport(transport),
98+
inner: jsonrpc::Client::with_transport(builder.build()),
10199
})
102100
}
103101

tests/test_rpc_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fn test_invalid_cookie_file() {
111111

112112
#[test]
113113
fn test_client_with_custom_transport() {
114-
use jsonrpc::http::minreq_http::Builder;
114+
use jsonrpc::http::bitreq_http::Builder;
115115

116116
let (_, node) = setup();
117117

0 commit comments

Comments
 (0)