mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 16:05:00 -05:00
make valid attest creation fill aggregate bitfield
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user