diff --git a/Messages.py b/Messages.py index 17e104034c7dd890cdca0d5e89893135afa9a118..bdeecfee9a9a0a44c31d4ebdf07af0e0ad188fdb 100644 --- a/Messages.py +++ b/Messages.py @@ -1,12 +1,8 @@ - -from __future__ import annotations from dataclasses import dataclass from Transaction import Transaction from typing import TYPE_CHECKING from uuid import uuid4 -if TYPE_CHECKING: - from TransactionDeliverer import TransactionDeliverer @dataclass class Message: @@ -30,7 +26,7 @@ class TransactionMessage(Message): generate_timestamp: float deliverable: bool = False - def receive_action(self, td: TransactionDeliverer) -> bool: + def receive_action(self, td) -> bool: td.process_transaction_message(self) return True @@ -39,7 +35,7 @@ class ProposedPriorityMessage(Message): transaction_ID: str proposed_priority: int - def receive_action(self, td: TransactionDeliverer) -> bool: + def receive_action(self, td) -> bool: td.process_proposed_priority_message(self) return False @@ -50,7 +46,7 @@ class AgreedPriorityMessage(Message): agreed_priority: int proposer: str - def receive_action(self, td: TransactionDeliverer) -> bool: + def receive_action(self, td) -> bool: td.process_agreed_priority_message(self) return True