Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.18: Remove unnecessary unwrap from simulate_transaction_unchecked() (backport of #35375) #35397

Merged
merged 1 commit into from
Mar 3, 2024
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
11 changes: 7 additions & 4 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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, .. } => (
Expand Down
Loading