mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 10:56:14 +03:00
server: Hint data
parameter of make_msg
(#11876)
This commit is contained in:
parent
a9fa0b0541
commit
a221726770
@ -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)
|
||||
|
||||
|
@ -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
|
||||
@ -41,5 +41,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))
|
||||
|
Loading…
Reference in New Issue
Block a user