From a84953ccfd47c56b45f9ca30d6377a61f8fce465 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 20:16:00 +0000 Subject: [PATCH] Improve program deployment error message (#17717) (#17725) (cherry picked from commit 39654d3fa526a4cfb909483d754f01928d25ae49) Co-authored-by: Jack May --- cli/src/program.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/program.rs b/cli/src/program.rs index fe6bd76095..d1592d2493 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -150,7 +150,7 @@ impl ProgramSubCommands for App<'_, '_> { pubkey!(Arg::with_name("program_id") .long("program-id") .value_name("PROGRAM_ID"), - "Executable program's address, must be a signer for initial deploys, can be a pubkey for upgrades \ + "Executable program's address, must be a keypair for initial deploys, can be a pubkey for upgrades \ [default: address of keypair at /path/to/program-keypair.json if present, otherwise a random address]"), ) .arg( @@ -886,6 +886,11 @@ fn process_program_deploy( )?; let result = if do_deploy { + if program_signer.is_none() { + return Err( + "Initial deployments require a keypair be provided for the program id".into(), + ); + } do_process_program_write_and_deploy( rpc_client.clone(), config,