From 08082df8796bdbebcc75e1a2edf0dc5b902d2fa2 Mon Sep 17 00:00:00 2001 From: Jon C Date: Fri, 5 Jan 2024 21:25:50 +0100 Subject: [PATCH] clap-utils: Forbid multiple values for `--signer` (#34482) * clap-utils: Do not allow multiple values for --signer * Add changelog entry --- CHANGELOG.md | 1 + clap-utils/src/offline.rs | 1 + clap-v3-utils/src/offline.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e20f5eff7..6ddba7c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Release channels have their own copy of this changelog: * RPC's `simulateTransaction` now returns `innerInstructions` as `json`/`jsonParsed` (#34313). * Bigtable upload now includes entry summary data for each slot, stored in a new `entries` table + * Forbid multiple values for the `--signer` CLI flag, forcing users to specify multiple occurrences of `--signer`, one for each signature * Upgrade Notes * `solana-program` and `solana-sdk` default to support for Borsh v1, with limited backward compatibility for v0.10 and v0.9. Please upgrade to Borsh v1. diff --git a/clap-utils/src/offline.rs b/clap-utils/src/offline.rs index 08f2364df..79a5b0dba 100644 --- a/clap-utils/src/offline.rs +++ b/clap-utils/src/offline.rs @@ -52,6 +52,7 @@ fn signer_arg<'a, 'b>() -> Arg<'a, 'b> { .validator(is_pubkey_sig) .requires(BLOCKHASH_ARG.name) .multiple(true) + .number_of_values(1) .help(SIGNER_ARG.help) } diff --git a/clap-v3-utils/src/offline.rs b/clap-v3-utils/src/offline.rs index b9ccd2d4e..cfd71e2a6 100644 --- a/clap-v3-utils/src/offline.rs +++ b/clap-v3-utils/src/offline.rs @@ -53,7 +53,7 @@ fn signer_arg<'a>() -> Arg<'a> { .value_parser(value_parser!(PubkeySignature)) .requires(BLOCKHASH_ARG.name) .multiple_occurrences(true) - .multiple_values(true) + .multiple_values(false) .help(SIGNER_ARG.help) }