diff --git a/tools/manage_clvm.py b/tools/manage_clvm.py index a9d5a6c91e..3a6a8f7bdd 100644 --- a/tools/manage_clvm.py +++ b/tools/manage_clvm.py @@ -13,6 +13,8 @@ import typing import click import typing_extensions +from chia.types.blockchain_format.sized_bytes import bytes32 + here = pathlib.Path(__file__).parent.resolve() root = here.parent cache_path = root.joinpath(".chia_cache", "manage_clvm.json") @@ -99,7 +101,7 @@ def dump_cache(cache: Cache, file: typing.IO[str]) -> None: json.dump(cache, file, indent=4) -def generate_hash_bytes(hex_bytes: bytes) -> bytes: +def generate_hash_bytes(hex_bytes: bytes) -> bytes32: cleaned_blob = bytes.fromhex(hex_bytes.decode("utf-8")) serialize_program = SerializedProgram.from_bytes(cleaned_blob) return serialize_program.get_tree_hash() @@ -141,7 +143,7 @@ class ClvmBytes: hex_bytes = paths.hex.read_bytes() return cls( hex=hex_bytes, - hash=bytes.fromhex(hash_dict[paths.hash]) + hash=bytes32(bytes.fromhex(hash_dict[paths.hash])) if paths.hash in hash_dict else generate_hash_bytes(hex_bytes=hex_bytes), )