mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-11 01:28:17 +03:00
Merge commit '3f740d375c1d767681e44d4a22ab89b6e0cb7ad0' into checkpoint/long_lived_atari_from_main_3f740d375c1d767681e44d4a22ab89b6e0cb7ad0
This commit is contained in:
commit
baf09aaf0b
@ -14,7 +14,7 @@ from chia.plot_sync.exceptions import (
|
||||
PlotSyncException,
|
||||
SyncIdsMatchError,
|
||||
)
|
||||
from chia.plot_sync.util import ErrorCodes, State
|
||||
from chia.plot_sync.util import ErrorCodes, State, T_PlotSyncMessage
|
||||
from chia.protocols.harvester_protocol import (
|
||||
Plot,
|
||||
PlotSyncDone,
|
||||
@ -29,7 +29,6 @@ from chia.server.ws_connection import ProtocolMessageTypes, WSChiaConnection, ma
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.ints import int16, uint32, uint64
|
||||
from chia.util.misc import get_list_or_len
|
||||
from chia.util.streamable import _T_Streamable
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -140,7 +139,7 @@ class Receiver:
|
||||
return self._total_plot_size
|
||||
|
||||
async def _process(
|
||||
self, method: Callable[[_T_Streamable], Any], message_type: ProtocolMessageTypes, message: Any
|
||||
self, method: Callable[[T_PlotSyncMessage], Any], message_type: ProtocolMessageTypes, message: T_PlotSyncMessage
|
||||
) -> None:
|
||||
log.debug(
|
||||
f"_process: node_id {self.connection().peer_node_id}, message_type: {message_type}, message: {message}"
|
||||
|
@ -1,4 +1,9 @@
|
||||
from enum import IntEnum
|
||||
from typing import TypeVar
|
||||
|
||||
from typing_extensions import Protocol
|
||||
|
||||
from chia.protocols.harvester_protocol import PlotSyncIdentifier
|
||||
|
||||
|
||||
class Constants:
|
||||
@ -25,3 +30,12 @@ class ErrorCodes(IntEnum):
|
||||
plot_already_available = 5
|
||||
plot_not_available = 6
|
||||
sync_ids_match = 7
|
||||
|
||||
|
||||
class PlotSyncMessage(Protocol):
|
||||
@property
|
||||
def identifier(self) -> PlotSyncIdentifier:
|
||||
pass
|
||||
|
||||
|
||||
T_PlotSyncMessage = TypeVar("T_PlotSyncMessage", bound=PlotSyncMessage)
|
||||
|
Loading…
Reference in New Issue
Block a user