pay subcommand now accepts a keypair file for convenience (#6703)

This commit is contained in:
Michael Vines 2019-11-04 09:36:49 -07:00 committed by GitHub
parent 8b2327ed34
commit a0127e63c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -356,7 +356,7 @@ pub fn parse_command(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, Box<dyn
},
("pay", Some(matches)) => {
let lamports = amount_of(matches, "amount", "unit").expect("Invalid amount");
let to = value_of(&matches, "to").unwrap();
let to = pubkey_of(&matches, "to").unwrap();
let timestamp = if matches.is_present("timestamp") {
// Parse input for serde_json
let date_string = if !matches.value_of("timestamp").unwrap().contains('Z') {
@ -1288,10 +1288,10 @@ pub fn app<'ab, 'v>(name: &str, about: &'ab str, version: &'v str) -> App<'ab, '
.arg(
Arg::with_name("to")
.index(1)
.value_name("PUBKEY")
.value_name("TO PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey)
.validator(is_pubkey_or_keypair)
.help("The pubkey of recipient"),
)
.arg(