instead of incrementing interaction counter, just substitue the current state

This commit is contained in:
pedrocarlo
2025-09-22 12:29:00 -03:00
parent 1d4b301f05
commit 05034e1f9d
2 changed files with 7 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ pub(crate) fn execute_interactions(
last_execution.interaction_index = state.interaction_pointer;
let mut turso_state = state.clone();
let mut rusqlite_state = state.clone();
// first execute turso
let turso_res = super::execution::execute_plan(
@@ -92,8 +93,6 @@ pub(crate) fn execute_interactions(
&mut turso_state,
);
let mut rusqlite_state = state.clone();
// second execute rusqlite
let rusqlite_res = super::execution::execute_plan(
&mut rusqlite_env,
@@ -112,7 +111,9 @@ pub(crate) fn execute_interactions(
return ExecutionResult::new(history, Some(err));
}
state.interaction_pointer += 1;
assert_eq!(turso_state, rusqlite_state);
*state = turso_state;
// Check if the maximum time for the simulation has been reached
if now.elapsed().as_secs() >= env.opts.max_time_simulation as u64 {

View File

@@ -142,7 +142,9 @@ pub(crate) fn execute_plans(
return ExecutionResult::new(history, Some(err));
}
state.interaction_pointer += 1;
assert_eq!(turso_state, doublecheck_state);
*state = turso_state;
// Check if the maximum time for the simulation has been reached
if now.elapsed().as_secs() >= env.opts.max_time_simulation as u64 {