Merge commit 'a221726770a736f87b34136d6456e063a985aa5d' into checkpoint/long_lived_atari_from_main_a221726770a736f87b34136d6456e063a985aa5d

This commit is contained in:
Amine Khaldi 2022-07-18 21:37:34 +01:00
commit 361b27becb
No known key found for this signature in database
GPG Key ID: B1C074FFC904E2D9
2 changed files with 5 additions and 2 deletions

View File

@ -50,6 +50,9 @@ class PayloadType(Protocol):
def __init__(self, identifier: PlotSyncIdentifier, *args: object) -> None:
...
def __bytes__(self) -> bytes:
pass
T = TypeVar("T", bound=PayloadType)

View File

@ -1,6 +1,6 @@
from dataclasses import dataclass
from enum import IntEnum
from typing import Any, Optional
from typing import Optional, SupportsBytes, Union
from chia.protocols.protocol_message_types import ProtocolMessageTypes
from chia.util.ints import uint8, uint16
@ -42,5 +42,5 @@ class Message(Streamable):
data: bytes
def make_msg(msg_type: ProtocolMessageTypes, data: Any) -> Message:
def make_msg(msg_type: ProtocolMessageTypes, data: Union[bytes, SupportsBytes]) -> Message:
return Message(uint8(msg_type.value), None, bytes(data))