make valid attest creation fill aggregate bitfield

This commit is contained in:
protolambda
2019-05-17 21:36:17 +02:00
parent 0f00b43698
commit a10aba4bb9
3 changed files with 3 additions and 3 deletions

View File

@@ -78,6 +78,7 @@ def get_valid_attestation(state, slot=None, signed=False):
data=attestation_data,
custody_bitfield=custody_bitfield,
)
fill_aggregate_attestation(state, attestation)
if signed:
sign_attestation(state, attestation)
return attestation

View File

@@ -53,13 +53,11 @@ def next_epoch_with_attestations(state,
slot_to_attest = post_state.slot - spec.MIN_ATTESTATION_INCLUSION_DELAY + 1
if slot_to_attest >= get_epoch_start_slot(get_current_epoch(post_state)):
cur_attestation = get_valid_attestation(post_state, slot_to_attest)
fill_aggregate_attestation(post_state, cur_attestation)
block.body.attestations.append(cur_attestation)
if fill_prev_epoch:
slot_to_attest = post_state.slot - spec.SLOTS_PER_EPOCH + 1
prev_attestation = get_valid_attestation(post_state, slot_to_attest)
fill_aggregate_attestation(post_state, prev_attestation)
block.body.attestations.append(prev_attestation)
state_transition(post_state, block)

View File

@@ -157,7 +157,8 @@ def test_attester_slashing(state):
pre_state = deepcopy(state)
attester_slashing = get_valid_attester_slashing(state)
validator_index = attester_slashing.attestation_1.custody_bit_0_indices[0]
validator_index = (attester_slashing.attestation_1.custody_bit_0_indices +
attester_slashing.attestation_1.custody_bit_1_indices)[0]
assert not state.validator_registry[validator_index].slashed