Skip to content

Commit b29a37c

Browse files
mergify[bot]Tyera
andauthored
v1.14: cli: require one or more authority params in stake-authorized-checked (backport of #30863) (#30865)
cli: require one or more authority params in `stake-authorized-checked` (#30863) * Require one or more authority params * Add auth list len check (cherry picked from commit 0291e8c) Co-authored-by: Tyera <tyera@solana.com>
1 parent f1ccc41 commit b29a37c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/src/stake.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ impl StakeSubCommands for App<'_, '_> {
390390
.value_name("KEYPAIR")
391391
.takes_value(true)
392392
.validator(is_valid_signer)
393+
.required_unless("new_withdraw_authority")
393394
.help("New authorized staker")
394395
)
395396
.arg(
@@ -398,6 +399,7 @@ impl StakeSubCommands for App<'_, '_> {
398399
.value_name("KEYPAIR")
399400
.takes_value(true)
400401
.validator(is_valid_signer)
402+
.required_unless("new_stake_authority")
401403
.help("New authorized withdrawer")
402404
)
403405
.arg(stake_authority_arg())
@@ -946,6 +948,11 @@ pub fn parse_stake_authorize(
946948
default_signer.generate_unique_signers(bulk_signers, matches, wallet_manager)?;
947949
let compute_unit_price = value_of(matches, COMPUTE_UNIT_PRICE_ARG.name);
948950

951+
if new_authorizations.is_empty() {
952+
return Err(CliError::BadParameter(
953+
"New authorization list must include at least one authority".to_string(),
954+
));
955+
}
949956
let new_authorizations = new_authorizations
950957
.into_iter()
951958
.map(

0 commit comments

Comments
 (0)