Skip to content

Commit 04e5627

Browse files
starknet_os_flow_tests: more informative execution failure
1 parent 003de2c commit 04e5627

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};
@@ -114,11 +113,17 @@ pub(crate) fn execute_transactions<S: FlowTestState>(
114113

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

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

0 commit comments

Comments
 (0)