diff --git a/chia/types/blockchain_format/program.py b/chia/types/blockchain_format/program.py index 3a8b6124dcd5..b585c328c27a 100644 --- a/chia/types/blockchain_format/program.py +++ b/chia/types/blockchain_format/program.py @@ -6,8 +6,8 @@ from clvm.casts import int_from_bytes from clvm.EvalError import EvalError from clvm.operators import OP_REWRITE, OPERATOR_LOOKUP -from clvm.serialize import sexp_buffer_from_stream, sexp_from_stream, sexp_to_stream -from clvm_rs import STRICT_MODE, deserialize_and_run_program +from clvm.serialize import sexp_from_stream, sexp_to_stream +from clvm_rs import STRICT_MODE, deserialize_and_run_program, serialized_length from clvm_tools.curry import curry, uncurry from chia.types.blockchain_format.sized_bytes import bytes32 @@ -148,8 +148,8 @@ class SerializedProgram: @classmethod def parse(cls, f) -> "SerializedProgram": - tmp = sexp_buffer_from_stream(f) - return SerializedProgram.from_bytes(tmp) + length = serialized_length(f.getvalue()[f.tell() :]) + return SerializedProgram.from_bytes(f.read(length)) def stream(self, f): f.write(self._buf) diff --git a/setup.py b/setup.py index ab6bc7544709..c5cf95db357e 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ "chiabip158==1.0", # bip158-style wallet filters "chiapos==1.0.1", # proof of space "clvm==0.9.6", - "clvm_rs==0.1.6", + "clvm_rs==0.1.7", "clvm_tools==0.4.3", "aiohttp==3.7.4", # HTTP server for full node rpc "aiosqlite==0.17.0", # asyncio wrapper for sqlite, to store blocks