diff --git a/cli/src/stake.rs b/cli/src/stake.rs index 4444c4462..0064f87e6 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -392,6 +392,7 @@ impl StakeSubCommands for App<'_, '_> { .value_name("KEYPAIR") .takes_value(true) .validator(is_valid_signer) + .required_unless("new_withdraw_authority") .help("New authorized staker") ) .arg( @@ -400,6 +401,7 @@ impl StakeSubCommands for App<'_, '_> { .value_name("KEYPAIR") .takes_value(true) .validator(is_valid_signer) + .required_unless("new_stake_authority") .help("New authorized withdrawer") ) .arg(stake_authority_arg()) @@ -948,6 +950,11 @@ pub fn parse_stake_authorize( default_signer.generate_unique_signers(bulk_signers, matches, wallet_manager)?; let compute_unit_price = value_of(matches, COMPUTE_UNIT_PRICE_ARG.name); + if new_authorizations.is_empty() { + return Err(CliError::BadParameter( + "New authorization list must include at least one authority".to_string(), + )); + } let new_authorizations = new_authorizations .into_iter() .map(