Skip to content

Commit

Permalink
Try refactoring TransientStatePersistence test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadliaJerad committed Dec 5, 2024
1 parent 4cf1608 commit f2f3605
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/C/src/federated/transient/TransientStatePersistence.lf
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ reactor Middle {
lf_set(join, true);
=}

reaction(in_from_persistence) {=
self->middle_state = in_from_persistence->value;
lf_print("Recieved the latest state of: {%c,%d} at " PRINTF_TIME ".",
self->middle_state.state_char,
self->middle_state.state_count,
lf_time_logical_elapsed());
=}

// When an input is received, the internal state is updated, and then sent to
// Persistance.
reaction(in) -> out, out_to_persistence {=
Expand All @@ -144,6 +136,14 @@ reactor Middle {
lf_stop();
}
=}

reaction(in_from_persistence) {=
self->middle_state = in_from_persistence->value;
lf_print("Recieved the latest state of: {%c,%d} at " PRINTF_TIME ".",
self->middle_state.state_char,
self->middle_state.state_count,
lf_time_logical_elapsed());
=}
}

/**
Expand Down

0 comments on commit f2f3605

Please sign in to comment.