diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 98a8eda628da74..b15f3f6229a5f6 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -4295,9 +4295,7 @@ impl Bank { let post_simulation_accounts = loaded_transactions .into_iter() .next() - .unwrap() - .0 - .ok() + .and_then(|(loaded_transactions_res, _)| loaded_transactions_res.ok()) .map(|loaded_transaction| { loaded_transaction .accounts @@ -4319,7 +4317,12 @@ impl Bank { debug!("simulate_transaction: {:?}", timings); - let execution_result = execution_results.pop().unwrap(); + let execution_result = + execution_results + .pop() + .unwrap_or(TransactionExecutionResult::NotExecuted( + TransactionError::InvalidProgramForExecution, + )); let flattened_result = execution_result.flattened_result(); let (logs, return_data, inner_instructions) = match execution_result { TransactionExecutionResult::Executed { details, .. } => (