aggregation_bitfield - bits

This commit is contained in:
Danny Ryan 2019-06-28 23:38:14 -06:00
parent 1885e285e3
commit bc5e947efc
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 2 additions and 2 deletions

View File

@ -49,10 +49,10 @@ def add_mock_attestations(spec, state, epoch, att_ratio, source, target):
# Create a bitfield filled with the given count per attestation,
# exactly on the right-most part of the committee field.
attesting_count = math.ceil(size * att_ratio)
aggregation_bitfield = ((1 << attesting_count) - 1).to_bytes(length=((size + 7) // 8), byteorder='big')
aggregation_bits = [i < attesting_count for i in range(size)]
attestations.append(spec.PendingAttestation(
aggregation_bitfield=aggregation_bitfield,
aggregation_bits=aggregation_bits,
data=spec.AttestationData(
beacon_block_root=b'\xaa' * 32,
source=source,