Transition to ureq http client (#5777)

* Transition to ureq http client

* Remove unwrap
This commit is contained in:
Tyera Eulberg
2019-09-04 12:11:44 -07:00
committed by GitHub
parent 355640b5db
commit b19d9a50d3
16 changed files with 236 additions and 324 deletions

View File

@ -21,7 +21,6 @@ lazy_static = "1.4.0"
log = "0.4.8"
num-traits = "0.2"
pretty-hex = "0.1.0"
reqwest = "0.9.20"
serde = "1.0.99"
serde_derive = "1.0.99"
serde_json = "1.0.40"
@ -38,6 +37,7 @@ solana-stake-api = { path = "../programs/stake_api", version = "0.19.0-pre0" }
solana-storage-api = { path = "../programs/storage_api", version = "0.19.0-pre0" }
solana-vote-api = { path = "../programs/vote_api", version = "0.19.0-pre0" }
solana-vote-signer = { path = "../vote-signer", version = "0.19.0-pre0" }
ureq = "0.11.0"
url = "2.1.0"
[dev-dependencies]

View File

@ -4,7 +4,6 @@ use crate::{
};
use bincode::deserialize;
use clap::ArgMatches;
use reqwest::Client;
use serde_derive::{Deserialize, Serialize};
use serde_json::{Map, Value};
use solana_client::rpc_client::RpcClient;
@ -88,8 +87,7 @@ fn verify_keybase(
"https://keybase.pub/{}/solana/validator-{:?}",
keybase_username, validator_pubkey
);
let client = Client::new();
if client.head(&url).send()?.status().is_success() {
if ureq::head(&url).call().ok() {
Ok(())
} else {
Err(format!("keybase_username could not be confirmed at: {}. Please add this pubkey file to your keybase profile to connect", url))?
@ -103,7 +101,6 @@ fn verify_keybase(
}
fn parse_args(matches: &ArgMatches<'_>) -> Value {
println!("{:?}", matches);
let mut map = Map::new();
map.insert(
"name".to_string(),