Bump reqwest from 0.9.24 to 0.10.0 (#7642)
* Bump reqwest from 0.9.24 to 0.10.0 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.24 to 0.10.0. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Make reqwest::blocking specific Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
parent
07855e3125
commit
57858b8015
File diff suppressed because it is too large
Load Diff
|
@ -23,7 +23,7 @@ indicatif = "0.13.0"
|
|||
humantime = "1.3.0"
|
||||
num-traits = "0.2"
|
||||
pretty-hex = "0.1.1"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
serde = "1.0.104"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.44"
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
};
|
||||
use bincode::deserialize;
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use reqwest::Client;
|
||||
use reqwest::blocking::Client;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ jsonrpc-core = "14.0.5"
|
|||
log = "0.4.8"
|
||||
rand = "0.6.5"
|
||||
rayon = "1.2.0"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
serde = "1.0.104"
|
||||
serde_derive = "1.0.103"
|
||||
serde_json = "1.0.44"
|
||||
|
|
|
@ -9,20 +9,20 @@ use solana_sdk::clock::{DEFAULT_TICKS_PER_SECOND, DEFAULT_TICKS_PER_SLOT};
|
|||
use std::{thread::sleep, time::Duration};
|
||||
|
||||
pub struct RpcClientRequest {
|
||||
client: reqwest::Client,
|
||||
client: reqwest::blocking::Client,
|
||||
url: String,
|
||||
}
|
||||
|
||||
impl RpcClientRequest {
|
||||
pub fn new(url: String) -> Self {
|
||||
Self {
|
||||
client: reqwest::Client::new(),
|
||||
client: reqwest::blocking::Client::new(),
|
||||
url,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_timeout(url: String, timeout: Duration) -> Self {
|
||||
let client = reqwest::Client::builder()
|
||||
let client = reqwest::blocking::Client::builder()
|
||||
.timeout(timeout)
|
||||
.build()
|
||||
.expect("build rpc client");
|
||||
|
@ -51,7 +51,7 @@ impl GenericRpcClientRequest for RpcClientRequest {
|
|||
.body(request_json.to_string())
|
||||
.send()
|
||||
{
|
||||
Ok(mut response) => {
|
||||
Ok(response) => {
|
||||
if !response.status().is_success() {
|
||||
return Err(response.error_for_status().unwrap_err().into());
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ reed-solomon-erasure = { package = "solana-reed-solomon-erasure", version = "4.0
|
|||
[dev-dependencies]
|
||||
hex-literal = "0.2.1"
|
||||
matches = "0.1.6"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
serial_test = "0.3.2"
|
||||
serial_test_derive = "0.3.1"
|
||||
systemstat = "0.1.5"
|
||||
|
|
|
@ -18,7 +18,7 @@ fn test_rpc_send_tx() {
|
|||
let (server, leader_data, alice, ledger_path) = new_validator_for_tests();
|
||||
let bob_pubkey = Pubkey::new_rand();
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -27,7 +27,7 @@ fn test_rpc_send_tx() {
|
|||
});
|
||||
let rpc_addr = leader_data.rpc;
|
||||
let rpc_string = get_rpc_request_str(rpc_addr, false);
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
@ -44,7 +44,7 @@ fn test_rpc_send_tx() {
|
|||
let tx = system_transaction::transfer(&alice, &bob_pubkey, 20, blockhash);
|
||||
let serial_tx = serialize(&tx).unwrap();
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -53,7 +53,7 @@ fn test_rpc_send_tx() {
|
|||
});
|
||||
let rpc_addr = leader_data.rpc;
|
||||
let rpc_string = get_rpc_request_str(rpc_addr, false);
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
@ -64,7 +64,7 @@ fn test_rpc_send_tx() {
|
|||
|
||||
let mut confirmed_tx = false;
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -73,7 +73,7 @@ fn test_rpc_send_tx() {
|
|||
});
|
||||
|
||||
for _ in 0..solana_sdk::clock::DEFAULT_TICKS_PER_SLOT {
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
@ -104,7 +104,7 @@ fn test_rpc_invalid_requests() {
|
|||
let bob_pubkey = Pubkey::new_rand();
|
||||
|
||||
// test invalid get_balance request
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -113,7 +113,7 @@ fn test_rpc_invalid_requests() {
|
|||
});
|
||||
let rpc_addr = leader_data.rpc;
|
||||
let rpc_string = get_rpc_request_str(rpc_addr, false);
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
@ -124,7 +124,7 @@ fn test_rpc_invalid_requests() {
|
|||
assert_eq!(the_error, "Invalid request");
|
||||
|
||||
// test invalid get_account_info request
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -133,7 +133,7 @@ fn test_rpc_invalid_requests() {
|
|||
});
|
||||
let rpc_addr = leader_data.rpc;
|
||||
let rpc_string = get_rpc_request_str(rpc_addr, false);
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
@ -144,7 +144,7 @@ fn test_rpc_invalid_requests() {
|
|||
assert_eq!(the_error, "Invalid request");
|
||||
|
||||
// test invalid get_account_info request
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let request = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
@ -153,7 +153,7 @@ fn test_rpc_invalid_requests() {
|
|||
});
|
||||
let rpc_addr = leader_data.rpc;
|
||||
let rpc_string = get_rpc_request_str(rpc_addr, false);
|
||||
let mut response = client
|
||||
let response = client
|
||||
.post(&rpc_string)
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.body(request.to_string())
|
||||
|
|
|
@ -22,7 +22,7 @@ indicatif = "0.13.0"
|
|||
lazy_static = "1.4.0"
|
||||
log = "0.4.8"
|
||||
nix = "0.16.1"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
serde = "1.0.104"
|
||||
serde_derive = "1.0.103"
|
||||
serde_yaml = "0.8.11"
|
||||
|
|
|
@ -79,7 +79,7 @@ fn download_to_temp_archive(
|
|||
let temp_dir = TempDir::new(clap::crate_name!())?;
|
||||
let temp_file = temp_dir.path().join("release.tar.bz2");
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
|
||||
let progress_bar = new_spinner_progress_bar();
|
||||
progress_bar.set_message(&format!("{}Downloading...", TRUCK));
|
||||
|
|
|
@ -12,7 +12,7 @@ edition = "2018"
|
|||
env_logger = "0.7.1"
|
||||
lazy_static = "1.4.0"
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
solana-sdk = { path = "../sdk", version = "0.23.0" }
|
||||
sys-info = "0.5.8"
|
||||
|
||||
|
|
|
@ -97,12 +97,12 @@ impl MetricsWriter for InfluxDbMetricsWriter {
|
|||
line.push_str(&format!(" {}\n", &point.timestamp));
|
||||
}
|
||||
|
||||
let client = reqwest::Client::builder()
|
||||
let client = reqwest::blocking::Client::builder()
|
||||
.timeout(Duration::from_secs(5))
|
||||
.build()
|
||||
.unwrap();
|
||||
let response = client.post(write_url.as_str()).body(line).send();
|
||||
if let Ok(mut resp) = response {
|
||||
if let Ok(resp) = response {
|
||||
info!(
|
||||
"submit response: {} {}",
|
||||
resp.status(),
|
||||
|
@ -402,7 +402,7 @@ pub fn query(q: &str) -> Result<String, String> {
|
|||
&config.host, &config.username, &config.password, &q
|
||||
);
|
||||
|
||||
let response = reqwest::get(query_url.as_str())
|
||||
let response = reqwest::blocking::get(query_url.as_str())
|
||||
.map_err(|err| err.to_string())?
|
||||
.text()
|
||||
.map_err(|err| err.to_string())?;
|
||||
|
|
|
@ -10,7 +10,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
clap="2.33.0"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "json", "rustls-tls"] }
|
||||
serde="1.0.104"
|
||||
serde_derive="1.0.103"
|
||||
serde_json = "1.0.44"
|
||||
|
|
|
@ -7,10 +7,10 @@ use std::io::prelude::*;
|
|||
|
||||
fn get_block_raw(hash: &str) -> String {
|
||||
let qs = format!("https://blockchain.info/block/{}?format=hex", hash);
|
||||
let body = reqwest::get(&qs);
|
||||
let body = reqwest::blocking::get(&qs);
|
||||
match body {
|
||||
Err(e) => panic!("rest request failed {}", e),
|
||||
Ok(mut n) => {
|
||||
Ok(n) => {
|
||||
if n.status().is_success() {
|
||||
n.text().unwrap()
|
||||
} else {
|
||||
|
|
|
@ -28,10 +28,10 @@ struct JsonBH {
|
|||
#[allow(dead_code)]
|
||||
fn get_header_json(hash: &str) -> JsonBH {
|
||||
let qs = format!("https://www.blockchain.info/rawblock/{}", hash);
|
||||
let body = reqwest::get(&qs);
|
||||
let body = reqwest::blocking::get(&qs);
|
||||
match body {
|
||||
Err(e) => panic!("rest request failed {}", e),
|
||||
Ok(mut n) => {
|
||||
Ok(n) => {
|
||||
if n.status().is_success() {
|
||||
let jsonbh: JsonBH = n.json().unwrap();
|
||||
jsonbh
|
||||
|
@ -44,10 +44,10 @@ fn get_header_json(hash: &str) -> JsonBH {
|
|||
|
||||
fn get_header_raw(hash: &str) -> String {
|
||||
let qs = format!("https://blockchain.info/block/{}?format=hex", hash);
|
||||
let body = reqwest::get(&qs);
|
||||
let body = reqwest::blocking::get(&qs);
|
||||
match body {
|
||||
Err(e) => panic!("rest request failed {}", e),
|
||||
Ok(mut n) => {
|
||||
Ok(n) => {
|
||||
if n.status().is_success() {
|
||||
let textbh: String = n.text().unwrap();
|
||||
let hs = &textbh[0..160]; // 160 characters since it's in hex format
|
||||
|
|
|
@ -15,7 +15,7 @@ chrono = { version = "0.4.10", features = ["serde"] }
|
|||
console = "0.9.1"
|
||||
log = "0.4.8"
|
||||
indicatif = "0.13.0"
|
||||
reqwest = { version = "0.9.24", default-features = false }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking"] }
|
||||
serde_json = "1.0.44"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "0.23.0" }
|
||||
solana-client = { path = "../client", version = "0.23.0" }
|
||||
|
|
|
@ -98,7 +98,7 @@ fn download_tar_bz2(
|
|||
let progress_bar = new_spinner_progress_bar();
|
||||
progress_bar.set_message(&format!("{}Downloading {}...", TRUCK, url));
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let client = reqwest::blocking::Client::new();
|
||||
let response = client
|
||||
.get(url.as_str())
|
||||
.send()
|
||||
|
|
|
@ -11,7 +11,7 @@ homepage = "https://solana.com/"
|
|||
[dependencies]
|
||||
clap = "2.33.0"
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.9.24", default-features = false, features = ["rustls-tls"] }
|
||||
reqwest = { version = "0.10.0", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
serde_json = "1.0"
|
||||
solana-clap-utils = { path = "../clap-utils", version = "0.23.0" }
|
||||
solana-client = { path = "../client", version = "0.23.0" }
|
||||
|
@ -22,4 +22,3 @@ solana-sdk = { path = "../sdk", version = "0.23.0" }
|
|||
[[bin]]
|
||||
name = "solana-watchtower"
|
||||
path = "src/main.rs"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use log::*;
|
||||
use reqwest::Client;
|
||||
use reqwest::blocking::Client;
|
||||
use serde_json::json;
|
||||
use std::env;
|
||||
|
||||
|
|
Loading…
Reference in New Issue