chia-blockchain/chia/consensus/cost_calculator.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

16 lines
481 B
Python

from dataclasses import dataclass
from typing import Optional
from chia.types.spend_bundle_conditions import SpendBundleConditions
from chia.util.ints import uint16, uint64
from chia.util.streamable import Streamable, streamable
@streamable
@dataclass(frozen=True)
class NPCResult(Streamable):
error: Optional[uint16]
conds: Optional[SpendBundleConditions]
cost: uint64 # The total cost of the block, including CLVM cost, cost of
# conditions and cost of bytes