--wait-for-supermajority now requires a SLOT

This commit is contained in:
Michael Vines
2020-03-02 11:47:58 -07:00
parent d677e83ed4
commit 13551885c2
5 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,7 @@
use crate::keypair::{parse_keypair_path, KeypairUrl, ASK_KEYWORD};
use chrono::DateTime;
use solana_sdk::{
clock::Slot,
hash::Hash,
pubkey::Pubkey,
signature::{read_keypair_file, Signature},
@ -93,6 +94,12 @@ pub fn is_url(string: String) -> Result<(), String> {
}
}
pub fn is_slot(slot: String) -> Result<(), String> {
slot.parse::<Slot>()
.map(|_| ())
.map_err(|e| format!("{:?}", e))
}
pub fn is_port(port: String) -> Result<(), String> {
port.parse::<u16>()
.map(|_| ())