diff --git a/bancor_research/bancor_simulator/v3/spec/network.py b/bancor_research/bancor_simulator/v3/spec/network.py index 9c3dd62..ecc297b 100644 --- a/bancor_research/bancor_simulator/v3/spec/network.py +++ b/bancor_research/bancor_simulator/v3/spec/network.py @@ -134,21 +134,22 @@ def copy_state(self, copy_type: str, state: State = None, timestamp: int = 0): ts = s.timestamp else: ts = timestamp + s.timestamp = timestamp self._backup_states[f"{copy_type}_{ts}"] = s.copy() return s - def update_state(self, state: State): + def update_state(self, state: State, timestamp: int = 0): """ Updates the global state at the end of each action. """ - self.global_state = self.copy_state("end", state) + self.global_state = self.copy_state("end", state, timestamp) - def next_transaction(self, state: State): + def next_transaction(self, state: State, timestamp: int = 0): """ Increments a new id and state for each action """ if self.log_state: - self.update_state(state) + self.update_state(state, timestamp) self.transaction_id += 1 def get_state(