Skip to content

Commit e7a7b06

Browse files
starknet_os_flow_tests: more informative execution failure
1 parent 4c5ff1a commit e7a7b06

File tree

1 file changed

+11
-6
lines changed
  • crates/starknet_os_flow_tests/src

1 file changed

+11
-6
lines changed

crates/starknet_os_flow_tests/src/utils.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use blockifier::blockifier::transaction_executor::{
99
BlockExecutionSummary,
1010
TransactionExecutionOutput,
1111
TransactionExecutor,
12-
TransactionExecutorError,
1312
};
1413
use blockifier::context::BlockContext;
1514
use blockifier::state::cached_state::{CachedState, CommitmentStateDiff, StateMaps};
@@ -109,11 +108,17 @@ pub(crate) fn execute_transactions<S: FlowTestState>(
109108

110109
// Execute the transactions and make sure none of them failed.
111110
let execution_deadline = None;
112-
let execution_outputs = executor
113-
.execute_txs(txs, execution_deadline)
114-
.into_iter()
115-
.collect::<Result<_, TransactionExecutorError>>()
116-
.expect("Unexpected error during execution.");
111+
let execution_results =
112+
executor.execute_txs(txs, execution_deadline).into_iter().collect::<Vec<Result<_, _>>>();
113+
let mut execution_outputs = Vec::new();
114+
for (tx_index, result) in execution_results.into_iter().enumerate() {
115+
match result {
116+
Ok(output) => execution_outputs.push(output),
117+
Err(error) => {
118+
panic!("Unexpected error during execution of tx at index {tx_index}: {error:?}.");
119+
}
120+
}
121+
}
117122

118123
// Finalize the block to get the state diff.
119124
let block_summary = executor.finalize().expect("Failed to finalize block.");

0 commit comments

Comments
 (0)