From 8b97545455ca3f2e211cb042ddda46c9ee31cac1 Mon Sep 17 00:00:00 2001 From: Adam Kelly Date: Wed, 7 Apr 2021 13:39:18 -0700 Subject: [PATCH] Use the new 2 argument form of substr from clvm 0.9.5 for a smaller deserializer --- chia/wallet/puzzles/chialisp_deserialisation.clvm | 8 ++++---- chia/wallet/puzzles/chialisp_deserialisation.clvm.hex | 2 +- .../puzzles/chialisp_deserialisation.clvm.hex.sha256tree | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm b/chia/wallet/puzzles/chialisp_deserialisation.clvm index 9820a1c0ed23..078cf8b27af0 100644 --- a/chia/wallet/puzzles/chialisp_deserialisation.clvm +++ b/chia/wallet/puzzles/chialisp_deserialisation.clvm @@ -10,8 +10,8 @@ (defun sexp_from_stream (input_stream) (if (= (substr input_stream 0 1) CONS_BOX_MARKER) - (cons_sexp_from_stream (sexp_from_stream (substr input_stream 1 (strlen input_stream)))) - (atom_from_stream (substr input_stream 1 (strlen input_stream)) (substr input_stream 0 1)) + (cons_sexp_from_stream (sexp_from_stream (substr input_stream 1))) + (atom_from_stream (substr input_stream 1) (substr input_stream 0 1)) ) ) @@ -44,7 +44,7 @@ (if (>s input_bits MAX_THREE_BYTE) (x "bad encoding") ;three byte length prefix - (list (concat (logand (quote 0x1f) input_bits) (substr input_file 0 1)) (substr input_file 1 (strlen input_file))) + (list (concat (logand (quote 0x1f) input_bits) (substr input_file 0 1)) (substr input_file 1)) ) ;two byte length prefix (list (logand (quote 0x3f) input_bits) input_file) @@ -52,7 +52,7 @@ ) (defun atom_from_stream_part_two ((size_to_read input_file)) - (list (substr input_file 0 size_to_read) (substr input_file size_to_read (strlen input_file))) + (list (substr input_file 0 size_to_read) (substr input_file size_to_read)) ) ; main diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex b/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex index 2a08c4a41cbe..773dfeac87ca 100644 --- a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex +++ b/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex @@ -1 +1 @@ -ff02ffff01ff05ffff02ff3effff04ff02ffff04ff05ff8080808080ffff04ffff01ffffff81ff7fff81df81bfffffff02ffff03ffff09ff0bffff01818080ffff01ff04ff80ffff04ff05ff808080ffff01ff02ffff03ffff0aff0bff1880ffff01ff02ff1affff04ff02ffff04ffff02ffff03ffff0aff0bff1c80ffff01ff02ffff03ffff0aff0bff1480ffff01ff08ffff018c62616420656e636f64696e6780ffff01ff04ffff0effff18ffff011fff0b80ffff0cff05ff80ffff01018080ffff04ffff0cff05ffff0101ffff0dff058080ff80808080ff0180ffff01ff04ffff18ffff013fff0b80ffff04ff05ff80808080ff0180ff80808080ffff01ff04ff0bffff04ff05ff80808080ff018080ff0180ff04ffff0cff15ff80ff0980ffff04ffff0cff15ff09ffff0dff158080ff808080ffff04ffff04ff05ff1380ffff04ff2bff808080ffff02ff16ffff04ff02ffff04ff09ffff04ffff02ff3effff04ff02ffff04ff15ff80808080ff8080808080ff02ffff03ffff09ffff0cff05ff80ffff010180ff1080ffff01ff02ff2effff04ff02ffff04ffff02ff3effff04ff02ffff04ffff0cff05ffff0101ffff0dff058080ff80808080ff80808080ffff01ff02ff12ffff04ff02ffff04ffff0cff05ffff0101ffff0dff058080ffff04ffff0cff05ff80ffff010180ff808080808080ff0180ff018080 +ff02ffff01ff05ffff02ff3effff04ff02ffff04ff05ff8080808080ffff04ffff01ffffff81ff7fff81df81bfffffff02ffff03ffff09ff0bffff01818080ffff01ff04ff80ffff04ff05ff808080ffff01ff02ffff03ffff0aff0bff1880ffff01ff02ff1affff04ff02ffff04ffff02ffff03ffff0aff0bff1c80ffff01ff02ffff03ffff0aff0bff1480ffff01ff08ffff018c62616420656e636f64696e6780ffff01ff04ffff0effff18ffff011fff0b80ffff0cff05ff80ffff01018080ffff04ffff0cff05ffff010180ff80808080ff0180ffff01ff04ffff18ffff013fff0b80ffff04ff05ff80808080ff0180ff80808080ffff01ff04ff0bffff04ff05ff80808080ff018080ff0180ff04ffff0cff15ff80ff0980ffff04ffff0cff15ff0980ff808080ffff04ffff04ff05ff1380ffff04ff2bff808080ffff02ff16ffff04ff02ffff04ff09ffff04ffff02ff3effff04ff02ffff04ff15ff80808080ff8080808080ff02ffff03ffff09ffff0cff05ff80ffff010180ff1080ffff01ff02ff2effff04ff02ffff04ffff02ff3effff04ff02ffff04ffff0cff05ffff010180ff80808080ff80808080ffff01ff02ff12ffff04ff02ffff04ffff0cff05ffff010180ffff04ffff0cff05ff80ffff010180ff808080808080ff0180ff018080 \ No newline at end of file diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree b/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree index cdac28ac0124..41e7d27a61a2 100644 --- a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree +++ b/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree @@ -1 +1 @@ -d402dac5ac7307f6c8e39c81d722b7e382f24a049df020ed19b9f0873b5c1e95 +4bc89f6455077b0a1527adf2d19f1ee2315eaf11e5540a3d43fbf2824af41eb4