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:
committed by
Tyera Eulberg
parent
07855e3125
commit
57858b8015
@ -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
|
||||
|
Reference in New Issue
Block a user