From 57d490c84f946e8ce6e269a22359cbaa631c41b9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2020 12:36:35 -0800 Subject: [PATCH] Minor cli fixes (bp #8061) (#8065) automerge --- cli/src/stake.rs | 2 +- client/src/rpc_client.rs | 24 ++++++++++++------------ client/src/rpc_client_request.rs | 5 +---- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/cli/src/stake.rs b/cli/src/stake.rs index 124dedeb0a..c881b8da08 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -285,7 +285,7 @@ impl StakeSubCommands for App<'_, '_> { .arg(withdraw_authority_arg()) ) .subcommand( - SubCommand::with_name("show-stake-account") + SubCommand::with_name("stake-account") .about("Show the contents of a stake account") .alias("show-stake-account") .arg( diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index df064ec26a..98080069fb 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -177,7 +177,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetVoteAccounts parse failure: {}", err), + format!("GetVoteAccounts parse failure: {:?}", err), ) }) } @@ -196,7 +196,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetClusterNodes parse failure: {}", err), + format!("GetClusterNodes parse failure: {:?}", err), ) }) } @@ -215,7 +215,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetConfirmedBlock parse failure: {}", err), + format!("GetConfirmedBlock parse failure: {:?}", err), ) }) } @@ -242,7 +242,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetConfirmedBlocks parse failure: {}", err), + format!("GetConfirmedBlocks parse failure: {:?}", err), ) }) } @@ -293,7 +293,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetEpochInfo parse failure: {}", err), + format!("GetEpochInfo parse failure: {:?}", err), ) }) } @@ -324,7 +324,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetLeaderSchedule failure: {}", err), + format!("GetLeaderSchedule failure: {:?}", err), ) }) } @@ -343,7 +343,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetEpochSchedule parse failure: {}", err), + format!("GetEpochSchedule parse failure: {:?}", err), ) }) } @@ -381,7 +381,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetVersion parse failure: {}", err), + format!("GetVersion parse failure: {:?}", err), ) }) } @@ -400,7 +400,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("MinimumLedgerSlot parse failure: {}", err), + format!("MinimumLedgerSlot parse failure: {:?}", err), ) }) } @@ -612,7 +612,7 @@ impl RpcClient { .map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("AccountNotFound: pubkey={}: {}", pubkey, err), + format!("AccountNotFound: pubkey={}: {:?}", pubkey, err), ) })? } @@ -698,7 +698,7 @@ impl RpcClient { .map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("AccountNotFound: pubkey={}: {}", pubkey, err), + format!("AccountNotFound: pubkey={}: {:?}", pubkey, err), ) })?; @@ -749,7 +749,7 @@ impl RpcClient { serde_json::from_value(response).map_err(|err| { io::Error::new( io::ErrorKind::Other, - format!("GetTransactionCount parse failure: {}", err), + format!("GetTransactionCount parse failure: {:?}", err), ) }) } diff --git a/client/src/rpc_client_request.rs b/client/src/rpc_client_request.rs index 3760c9e5f6..c076a2c544 100644 --- a/client/src/rpc_client_request.rs +++ b/client/src/rpc_client_request.rs @@ -15,10 +15,7 @@ pub struct RpcClientRequest { impl RpcClientRequest { pub fn new(url: String) -> Self { - Self { - client: reqwest::blocking::Client::new(), - url, - } + Self::new_with_timeout(url, Duration::from_secs(20)) } pub fn new_with_timeout(url: String, timeout: Duration) -> Self {