mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-14 04:34:43 +00:00
fix up attesation reward tests
This commit is contained in:
parent
1aa12034e5
commit
1688721554
@ -34,13 +34,19 @@ def test_genesis_epoch_no_attestations_no_penalties(spec, state):
|
||||
@spec_state_test
|
||||
def test_genesis_epoch_full_attestations_no_rewards(spec, state):
|
||||
attestations = []
|
||||
for slot in range(spec.SLOTS_PER_EPOCH - spec.MIN_ATTESTATION_INCLUSION_DELAY - 1):
|
||||
for slot in range(spec.SLOTS_PER_EPOCH - 1):
|
||||
# create an attestation for each slot
|
||||
if slot < spec.SLOTS_PER_EPOCH:
|
||||
attestation = get_valid_attestation(spec, state)
|
||||
fill_aggregate_attestation(spec, state, attestation, signed=True)
|
||||
attestations.append(attestation)
|
||||
# fill each created slot in state after inclusion delay
|
||||
if slot - spec.MIN_ATTESTATION_INCLUSION_DELAY >= 0:
|
||||
include_att = attestations[slot - spec.MIN_ATTESTATION_INCLUSION_DELAY]
|
||||
add_attestations_to_state(spec, state, [include_att], state.slot)
|
||||
next_slot(spec, state)
|
||||
add_attestations_to_state(spec, state, attestations, state.slot + spec.MIN_ATTESTATION_INCLUSION_DELAY)
|
||||
|
||||
# ensure has not cross the epoch boundary
|
||||
assert spec.compute_epoch_of_slot(state.slot) == spec.GENESIS_EPOCH
|
||||
|
||||
pre_state = deepcopy(state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user