Newer
Older
from dataclasses import dataclass
from Transaction import Transaction
from typing import TYPE_CHECKING
from uuid import uuid4
if TYPE_CHECKING:
from TransactionDeliverer import TransactionDeliverer
def receive_action(self):
raise NotImplementedError("This is an abstract method that should never be called")
@dataclass
class TransactionMessage(Message):
transaction: Transaction
def receive_action(self, td: TransactionDeliverer):
td.process_transaction_message(self)
@dataclass
class ProposedPriorityMessage(Message):
transaction_ID: str
proposed_priority: int
def receive_action(self, td: TransactionDeliverer):
td.process_proposed_priority_message(self)
@dataclass
class AgreedPriorityMessage(Message):
transaction_ID: str