Minor cli fixes (bp #8061) (#8065)

automerge
This commit is contained in:
mergify[bot]
2020-01-31 12:36:35 -08:00
committed by GitHub
parent aa8c9f6a98
commit 57d490c84f
3 changed files with 14 additions and 17 deletions

View File

@ -285,7 +285,7 @@ impl StakeSubCommands for App<'_, '_> {
.arg(withdraw_authority_arg()) .arg(withdraw_authority_arg())
) )
.subcommand( .subcommand(
SubCommand::with_name("show-stake-account") SubCommand::with_name("stake-account")
.about("Show the contents of a stake account") .about("Show the contents of a stake account")
.alias("show-stake-account") .alias("show-stake-account")
.arg( .arg(

View File

@ -177,7 +177,7 @@ impl RpcClient {
serde_json::from_value(response).map_err(|err| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, io::ErrorKind::Other,
format!("MinimumLedgerSlot parse failure: {}", err), format!("MinimumLedgerSlot parse failure: {:?}", err),
) )
}) })
} }
@ -612,7 +612,7 @@ impl RpcClient {
.map_err(|err| { .map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, io::ErrorKind::Other,
format!("AccountNotFound: pubkey={}: {}", pubkey, err), format!("AccountNotFound: pubkey={}: {:?}", pubkey, err),
) )
})? })?
} }
@ -698,7 +698,7 @@ impl RpcClient {
.map_err(|err| { .map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, 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| { serde_json::from_value(response).map_err(|err| {
io::Error::new( io::Error::new(
io::ErrorKind::Other, io::ErrorKind::Other,
format!("GetTransactionCount parse failure: {}", err), format!("GetTransactionCount parse failure: {:?}", err),
) )
}) })
} }

View File

@ -15,10 +15,7 @@ pub struct RpcClientRequest {
impl RpcClientRequest { impl RpcClientRequest {
pub fn new(url: String) -> Self { pub fn new(url: String) -> Self {
Self { Self::new_with_timeout(url, Duration::from_secs(20))
client: reqwest::blocking::Client::new(),
url,
}
} }
pub fn new_with_timeout(url: String, timeout: Duration) -> Self { pub fn new_with_timeout(url: String, timeout: Duration) -> Self {