@ -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(
|
||||||
|
@ -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),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
Reference in New Issue
Block a user