Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Improve program deployment error message (backport #17717) #17725

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down