Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EltonCN committed Dec 4, 2024
1 parent f8ebb62 commit 30a8a93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cst_python/memory_storage/logical_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def from_str(cls, string:str) -> "LogicalTime":

@classmethod
@abc.abstractmethod
def syncronize(cls, time0:"LogicalTime", time1:"LogicalTime") -> "LogicalTime":
def synchronize(cls, time0:"LogicalTime", time1:"LogicalTime") -> "LogicalTime":
'''
Compares two times, and return the current time.
Expand Down Expand Up @@ -114,7 +114,7 @@ def from_str(cls, string:str) -> "LamportTime":
return LamportTime(int(string))

@classmethod
def syncronize(cls, time0, time1) -> "LamportTime":
def synchronize(cls, time0, time1) -> "LamportTime":
if not (isinstance(time0, LamportTime) and isinstance(time1, LamportTime)):
raise ValueError("LamportTime can only synchonize LamportTime instances")

Expand Down
6 changes: 3 additions & 3 deletions src/cst_python/memory_storage/memory_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _retrieve_memory(self, memory:Memory) -> None:

MemoryEncoder.load_memory(memory, memory_dict)
message_time = LamportTime.from_str(memory_dict["logical_time"])
self._current_time = LamportTime.syncronize(self._current_time, message_time)
self._current_time = LamportTime.synchronize(self._current_time, message_time)

self._last_update[memory_name] = memory.get_timestamp()
self._memory_logical_time[memory_name] = message_time
Expand Down Expand Up @@ -277,7 +277,7 @@ def _handler_notify_transfer(self, message:dict[str,str]) -> None:
data = data = json.loads(message["data"])
if "logical_time" in data:
message_time = LamportTime.from_str(data["logical_time"])
self._current_time = LamportTime.syncronize(message_time, self._current_time)
self._current_time = LamportTime.synchronize(message_time, self._current_time)

memory_name = data["memory_name"]
if memory_name in self._waiting_request_events:
Expand All @@ -296,7 +296,7 @@ def _handler_transfer_memory(self, message:dict[str,str]) -> None:
data = json.loads(message["data"])
if "logical_time" in data:
message_time = LamportTime.from_str(data["logical_time"])
self._current_time = LamportTime.syncronize(message_time, self._current_time)
self._current_time = LamportTime.synchronize(message_time, self._current_time)

request = data["request"]

Expand Down
4 changes: 2 additions & 2 deletions tests/cst_python/memory_storage/test_lamport_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def test_increment(self):
assert time0._time == time0_time
assert time1._time == time0_time+1

def test_synchonize(self):
def test_synchronize(self):
time0 = LamportTime(initial_time=-10)
time1 = LamportTime(initial_time=55)

time_s = LamportTime.syncronize(time0, time1)
time_s = LamportTime.synchronize(time0, time1)

assert time_s > time0
assert time_s > time1
Expand Down

0 comments on commit 30a8a93

Please sign in to comment.