fix list lookup

This commit is contained in:
protolambda 2019-10-24 00:00:27 +08:00
parent e8a3eac55e
commit 9deda149da
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 2 additions and 2 deletions

View File

@ -183,11 +183,11 @@ def test_attestations_some_slashed(spec, state):
add_attestations_to_state(spec, state, [include_att], state.slot) add_attestations_to_state(spec, state, [include_att], state.slot)
next_slot(spec, state) next_slot(spec, state)
attesting_indices_before_slashings = spec.get_unslashed_attesting_indices(state, attestations) attesting_indices_before_slashings = list(spec.get_unslashed_attesting_indices(state, attestations))
# Slash maximum amount of validators allowed per epoch. # Slash maximum amount of validators allowed per epoch.
for i in range(spec.MIN_PER_EPOCH_CHURN_LIMIT): for i in range(spec.MIN_PER_EPOCH_CHURN_LIMIT):
spec.slash_validator(state, list(attesting_indices_before_slashings)[i]) spec.slash_validator(state, attesting_indices_before_slashings[i])
assert spec.compute_epoch_of_slot(state.slot) == spec.GENESIS_EPOCH + 1 assert spec.compute_epoch_of_slot(state.slot) == spec.GENESIS_EPOCH + 1
assert len(state.previous_epoch_attestations) == spec.SLOTS_PER_EPOCH assert len(state.previous_epoch_attestations) == spec.SLOTS_PER_EPOCH