Skip to content

Commit 6924d09

Browse files
committed
improve error message for close
1 parent 40d36dc commit 6924d09

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ async fn main() -> anyhow::Result<()> {
197197
.subcommand(SubCommand::with_name("list-program-pdas")
198198
.about("List all the PDA information associated with a program ID")
199199
.arg(Arg::with_name("program-id")
200+
.long("program-id")
200201
.required(true)
202+
.takes_value(true)
201203
.help("Program ID of the program to list PDAs for")))
202204
.get_matches();
203205

@@ -1128,6 +1130,5 @@ pub async fn list_program_pdas(program_id: Pubkey, url: Option<String>) -> anyho
11281130
println!("----------------------------------------------------------------");
11291131
println!("{}", build_params);
11301132
}
1131-
// println!("PDAs for program {}: {:?}", program_id, pdas);
11321133
Ok(())
11331134
}

src/solana_program.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ pub async fn process_close(program_address: Pubkey) -> anyhow::Result<()> {
310310
)?;
311311
} else {
312312
return Err(anyhow!(
313-
"Program account does not exist. Please provide the program address not PDA address."
313+
"No PDA found for signer {:?} and program address {:?}. Make sure you are providing the program address, not the PDA address. Check that a signer exists for the program by running `solana-verify list-program-pdas --program-id {:?}`",
314+
signer_pubkey,
315+
program_address,
316+
program_address
314317
));
315318
}
316319

0 commit comments

Comments
 (0)