Skip to content

Commit

Permalink
fix: ensure finalise transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
cdummett committed Jun 25, 2024
1 parent 986c249 commit 2681352
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vega_sim/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ def _run(
)
for agent in self.agents:
agent.finalise()
# Forward a number of transactions so finalise transactions can occur
for _ in range(60):
vega.wait_fn(1)
vega.wait_for_total_catchup()
vega.wait_for_core_catchup()
vega.wait_for_datanode_sync()

Expand Down Expand Up @@ -521,6 +525,10 @@ def _run(
raise (e)
else:
logging.warning(msg)
# Forward a number of transactions so finalise transactions can occur
for _ in range(60):
vega.wait_fn(1)
vega.wait_for_total_catchup()
if pause_at_completion:
input(
"Environment run completed. Pausing to allow inspection of state."
Expand Down

0 comments on commit 2681352

Please sign in to comment.