Add cluster-version subcommand to return entrypoint versions (#5464)

This commit is contained in:
Tyera Eulberg
2019-08-08 11:13:06 -06:00
committed by GitHub
parent 8c15214923
commit 4ae48b56f3
6 changed files with 65 additions and 13 deletions

View File

@@ -94,6 +94,25 @@ impl RpcClient {
})
}
pub fn get_version(&self) -> io::Result<String> {
let response = self
.client
.send(&RpcRequest::GetVersion, None, 0)
.map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("GetVersion request failure: {:?}", err),
)
})?;
serde_json::to_string(&response).map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("GetVersion parse failure: {}", err),
)
})
}
pub fn send_and_confirm_transaction<T: KeypairUtil>(
&self,
transaction: &mut Transaction,