Update test_libs/pyspec/eth2spec/utils/ssz/ssz_impl.py

Co-Authored-By: Diederik Loerakker <proto@protolambda.com>
This commit is contained in:
dankrad 2019-07-03 15:10:37 +01:00 committed by GitHub
parent 6422acdcdd
commit 619b2a3573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ def encode_series(values: Series):
def pack(values: Series): def pack(values: Series):
if isinstance(values, bytes): # Bytes and BytesN are already packed if isinstance(values, bytes): # Bytes and BytesN are already packed
return values return values
elif isinstance(values, Bitvector) or isinstance(values, Bitlist): elif isinstance(values, (Bitvector, Bitlist)):
as_bytearray = [0] * ((len(values) + 7) // 8) as_bytearray = [0] * ((len(values) + 7) // 8)
for i in range(len(values)): for i in range(len(values)):
as_bytearray[i // 8] |= values[i] << (i % 8) as_bytearray[i // 8] |= values[i] << (i % 8)