chia-blockchain/chia/simulator/simulator_protocol.py
dustinface a48fd43100
streamable: Simplify and force correct usage (#10509)
* streamable: Merge `strictdataclass` into `Streamable` class

* tests: Test not supported streamable types

* streamable: Reorder decorators

* streamable: Simplify streamable decorator and force correct usage/syntax

* streamable: Just move some stuff around in the file

* streamable: Improve syntax error messages

* mypy: Drop `type_checking.py` and `test_type_checking.py` from exclusion

* streamable: Use cached fields instead of `__annotations__`

This is now possible after merging `__post_init__` into `Streamable`

* Introduce `DefinitionError` as `StreamableError`

* `/t` -> `    `
2022-04-08 18:29:32 -07:00

20 lines
429 B
Python

from dataclasses import dataclass
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.ints import uint32
from chia.util.streamable import Streamable, streamable
@streamable
@dataclass(frozen=True)
class FarmNewBlockProtocol(Streamable):
puzzle_hash: bytes32
@streamable
@dataclass(frozen=True)
class ReorgProtocol(Streamable):
old_index: uint32
new_index: uint32
puzzle_hash: bytes32