From 5e28adf5561172cde56b5af09e8de481ff9fbd0c Mon Sep 17 00:00:00 2001 From: protolambda Date: Tue, 28 May 2019 00:51:27 +0200 Subject: [PATCH] bugfix: don't forget about var-length bytes getting a length mixin --- test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py b/test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py index 826714c96..96eaff481 100644 --- a/test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py +++ b/test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py @@ -110,7 +110,7 @@ def hash_tree_root(obj, typ): else: leaves = [hash_tree_root(elem, subtype) for elem in obj] leaf_root = merkleize_chunks(leaves) - return mix_in_length(leaf_root, len(obj)) if is_list_type(typ) else leaf_root + return mix_in_length(leaf_root, len(obj)) if is_list_kind(typ) else leaf_root elif is_container_type(typ): leaves = [hash_tree_root(field_value, field_typ) for field_value, field_typ in obj.get_typed_values()] return merkleize_chunks(chunkify(b''.join(leaves)))