Skip to content

Commit

Permalink
Improve program deployment error message (solana-labs#17717)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay authored Jun 3, 2021
1 parent 83b9a04 commit 39654d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,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(
Expand Down Expand Up @@ -889,6 +889,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,
Expand Down

0 comments on commit 39654d3

Please sign in to comment.