Use types for CLI value names (#8878)

* Use types for CLI value names

* keygen too

* More cleanup

* nonce keypair -> pubkey
This commit is contained in:
Greg Fitzgerald
2020-03-16 09:24:59 -06:00
committed by GitHub
parent ead6dc553a
commit eab4fe50a3
8 changed files with 102 additions and 102 deletions

View File

@@ -82,7 +82,7 @@ pub fn nonce_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
Arg::with_name(NONCE_AUTHORITY_ARG.name)
.long(NONCE_AUTHORITY_ARG.long)
.takes_value(true)
.value_name("KEYPAIR or PUBKEY or REMOTE WALLET PATH")
.value_name("KEYPAIR")
.validator(is_valid_signer)
.help(NONCE_AUTHORITY_ARG.help)
}
@@ -93,9 +93,9 @@ impl NonceSubCommands for App<'_, '_> {
SubCommand::with_name("authorize-nonce-account")
.about("Assign account authority to a new entity")
.arg(
Arg::with_name("nonce_account_keypair")
Arg::with_name("nonce_account_pubkey")
.index(1)
.value_name("NONCE_ACCOUNT")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -104,7 +104,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("new_authority")
.index(2)
.value_name("NEW_AUTHORITY_PUBKEY")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -113,7 +113,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("seed")
.long("seed")
.value_name("SEED STRING")
.value_name("STRING")
.takes_value(true)
.help("Seed for address generation; if specified, the resulting account will be at a derived address of the NONCE_ACCOUNT pubkey")
)
@@ -125,7 +125,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("nonce_account_keypair")
.index(1)
.value_name("NONCE ACCOUNT")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -134,7 +134,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("amount")
.index(2)
.value_name("AMOUNT")
.value_name("NUMBER")
.takes_value(true)
.required(true)
.validator(is_amount)
@@ -144,7 +144,7 @@ impl NonceSubCommands for App<'_, '_> {
Arg::with_name(NONCE_AUTHORITY_ARG.name)
.long(NONCE_AUTHORITY_ARG.long)
.takes_value(true)
.value_name("BASE58_PUBKEY")
.value_name("PUBKEY")
.validator(is_pubkey_or_keypair)
.help("Assign noncing authority to another entity"),
),
@@ -156,7 +156,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("nonce_account_pubkey")
.index(1)
.value_name("NONCE ACCOUNT")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -169,7 +169,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("nonce_account_keypair")
.index(1)
.value_name("NONCE ACCOUNT")
.value_name("KEYPAIR")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -184,7 +184,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("nonce_account_pubkey")
.index(1)
.value_name("NONCE ACCOUNT")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -203,7 +203,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("nonce_account_keypair")
.index(1)
.value_name("NONCE ACCOUNT")
.value_name("KEYPAIR")
.takes_value(true)
.required(true)
.validator(is_valid_signer)
@@ -212,7 +212,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("destination_account_pubkey")
.index(2)
.value_name("DESTINATION ACCOUNT")
.value_name("PUBKEY")
.takes_value(true)
.required(true)
.validator(is_pubkey_or_keypair)
@@ -221,7 +221,7 @@ impl NonceSubCommands for App<'_, '_> {
.arg(
Arg::with_name("amount")
.index(3)
.value_name("AMOUNT")
.value_name("NUMBER")
.takes_value(true)
.required(true)
.validator(is_amount)
@@ -279,7 +279,7 @@ pub fn parse_authorize_nonce_account(
default_signer_path: &str,
wallet_manager: Option<&Arc<RemoteWalletManager>>,
) -> Result<CliCommandInfo, CliError> {
let nonce_account = pubkey_of(matches, "nonce_account_keypair").unwrap();
let nonce_account = pubkey_of(matches, "nonce_account_pubkey").unwrap();
let new_authority = pubkey_of(matches, "new_authority").unwrap();
let (nonce_authority, nonce_authority_pubkey) =
signer_of(matches, NONCE_AUTHORITY_ARG.name, wallet_manager)?;