verify_bitiefld in aggregate signature section

This commit is contained in:
Danny Ryan 2019-01-30 10:39:08 -08:00 committed by GitHub
parent fb75c6dd55
commit 0e7953fe8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -1631,9 +1631,12 @@ For each `attestation` in `block.body.attestations`:
```python
assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1]
assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield)
assert len(attestation.aggregation_bitfield) <= len(attestation.custody_bitfield)
for i in range(len(attestation.aggregation_bitfield)):
crosslink_committee = get_crosslink_committee_at_slot(state, attestation.data.slot)[0]
verify_bitfield(attestation.aggregation_bitfield, len(crosslink_committee))
verify_bitfield(attestation.custody_bitfield, len(crosslink_committee))
for i in range(len(crosslink_committee):
if get_bitfield_bit(attestation.aggregation_bitfield, i) == 0b0:
assert get_bitfield_bit(attestation.custody_bitfield, i) == 0b0