cli: Error if program in genesis configuration doesn't exist
@@ -1573,6 +1573,13 @@ fn validator_flags(cfg: &WithPath<Config>) -> Result<Vec<String>> {
if let Some(test) = cfg.test.as_ref() {
if let Some(genesis) = &test.genesis {
for entry in genesis {
+ let program_path = Path::new(&entry.program);
+ if !program_path.exists() {
+ return Err(anyhow!(
+ "Program in genesis configuration does not exist at path: {}",
+ program_path.display()
+ ));
+ }
flags.push("--bpf-program".to_string());
flags.push(entry.address.clone());
flags.push(entry.program.clone());
