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
# Returns if the message needs to be rebroadcast
# for reliable multicast.
# This is TRUE only if receiving a multicasted message,
# not a unicasted message
def receive_action(self):
raise NotImplementedError("This is an abstract method that should never be called")
@dataclass
class TransactionMessage(Message):
transaction: Transaction
@dataclass
class ProposedPriorityMessage(Message):
transaction_ID: str
proposed_priority: int
@dataclass
class AgreedPriorityMessage(Message):
transaction_ID: str