From 6c6f180e0e6136ee101db2c7502709b77710e64d Mon Sep 17 00:00:00 2001 From: protolambda Date: Wed, 9 Sep 2020 13:04:53 +0200 Subject: [PATCH] clarify offsets serialization, thanks @imnisen, fix #1963 --- ssz/simple-serialize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssz/simple-serialize.md b/ssz/simple-serialize.md index 4f0c5c9fa..607dd0946 100644 --- a/ssz/simple-serialize.md +++ b/ssz/simple-serialize.md @@ -165,7 +165,7 @@ variable_lengths = [len(part) for part in variable_parts] assert sum(fixed_lengths + variable_lengths) < 2**(BYTES_PER_LENGTH_OFFSET * BITS_PER_BYTE) # Interleave offsets of variable-size parts with fixed-size parts -variable_offsets = [serialize(sum(fixed_lengths + variable_lengths[:i])) for i in range(len(value))] +variable_offsets = [serialize(uint32(sum(fixed_lengths + variable_lengths[:i]))) for i in range(len(value))] fixed_parts = [part if part != None else variable_offsets[i] for i, part in enumerate(fixed_parts)] # Return the concatenation of the fixed-size parts (offsets interleaved) with the variable-size parts