cli: Add --confirmed option to a couple commands, also add --no-header (#7112)

* Add --confirmed option to get-slot, get-epoch-info, get-transaction-count

* Add --no-header option
This commit is contained in:
Michael Vines
2019-11-24 17:34:18 -07:00
committed by GitHub
parent 702f7cc51d
commit d5beb8a9e4
4 changed files with 151 additions and 42 deletions

View File

@ -197,9 +197,16 @@ impl RpcClient {
}
pub fn get_epoch_info(&self) -> io::Result<RpcEpochInfo> {
self.get_epoch_info_with_commitment(CommitmentConfig::default())
}
pub fn get_epoch_info_with_commitment(
&self,
commitment_config: CommitmentConfig,
) -> io::Result<RpcEpochInfo> {
let response = self
.client
.send(&RpcRequest::GetEpochInfo, None, 0, None)
.send(&RpcRequest::GetEpochInfo, None, 0, commitment_config.ok())
.map_err(|err| {
io::Error::new(
io::ErrorKind::Other,