revert rename of to
This commit is contained in:
parent
5a16f99302
commit
8e815dd3f7
|
@ -234,7 +234,7 @@ def transition_state_to_leak(spec, state, epochs=None):
|
|||
_cache_dict = LRU(size=10)
|
||||
|
||||
|
||||
def inactivity_penalty_active(epochs=None):
|
||||
def leaking(epochs=None):
|
||||
|
||||
def deco(fn):
|
||||
def entry(*args, spec, state, **kw):
|
||||
|
|
|
@ -17,7 +17,7 @@ from eth2spec.test.helpers.attestations import (
|
|||
sign_attestation,
|
||||
prepare_state_with_attestations,
|
||||
)
|
||||
from eth2spec.test.helpers.rewards import inactivity_penalty_active
|
||||
from eth2spec.test.helpers.rewards import leaking
|
||||
from eth2spec.test.helpers.attester_slashings import get_indexed_attestation_participants
|
||||
from eth2spec.test.helpers.epoch_processing import run_epoch_processing_with
|
||||
from random import Random
|
||||
|
@ -205,7 +205,7 @@ def test_almost_empty_attestations(spec, state):
|
|||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_almost_empty_attestations_with_leak(spec, state):
|
||||
rng = Random(1234)
|
||||
yield from run_with_participation(spec, state, lambda slot, comm_index, comm: rng.sample(comm, 1))
|
||||
|
@ -220,7 +220,7 @@ def test_random_fill_attestations(spec, state):
|
|||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_random_fill_attestations_with_leak(spec, state):
|
||||
rng = Random(4567)
|
||||
yield from run_with_participation(spec, state, lambda slot, comm_index, comm: rng.sample(comm, len(comm) // 3))
|
||||
|
@ -235,7 +235,7 @@ def test_almost_full_attestations(spec, state):
|
|||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_almost_full_attestations_with_leak(spec, state):
|
||||
rng = Random(8901)
|
||||
yield from run_with_participation(spec, state, lambda slot, comm_index, comm: rng.sample(comm, len(comm) - 1))
|
||||
|
@ -249,7 +249,7 @@ def test_full_attestation_participation(spec, state):
|
|||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_attestation_participation_with_leak(spec, state):
|
||||
yield from run_with_participation(spec, state, lambda slot, comm_index, comm: comm)
|
||||
|
||||
|
|
|
@ -1,81 +1,81 @@
|
|||
from eth2spec.test.context import PHASE0, PHASE1, with_all_phases, with_phases, spec_state_test
|
||||
from eth2spec.test.helpers.rewards import inactivity_penalty_active
|
||||
from eth2spec.test.helpers.rewards import leaking
|
||||
import eth2spec.test.helpers.rewards as rewards_helpers
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_empty_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_empty(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_all_correct(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_half_full_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_half_full(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_quarter_full_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_partial(spec, state, 0.25)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_but_partial_participation_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_but_partial_participation(spec, state)
|
||||
|
||||
|
||||
@with_phases([PHASE0, PHASE1])
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_one_attestation_one_correct_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_one_attestation_one_correct(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_with_not_yet_activated_validators_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_with_not_yet_activated_validators(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_with_exited_validators_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_with_exited_validators(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_with_slashed_validators_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_with_slashed_validators(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_some_very_low_effective_balances_that_attested_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_some_very_low_effective_balances_that_attested(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_some_very_low_effective_balances_that_did_not_attest_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_some_very_low_effective_balances_that_did_not_attest(spec, state)
|
||||
|
||||
|
@ -89,7 +89,7 @@ def test_some_very_low_effective_balances_that_did_not_attest_leak(spec, state):
|
|||
|
||||
@with_phases([PHASE0, PHASE1])
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_half_correct_target_incorrect_head_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_fraction_incorrect(
|
||||
spec, state,
|
||||
|
@ -101,7 +101,7 @@ def test_full_half_correct_target_incorrect_head_leak(spec, state):
|
|||
|
||||
@with_phases([PHASE0, PHASE1])
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_correct_target_incorrect_head_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_fraction_incorrect(
|
||||
spec, state,
|
||||
|
@ -113,7 +113,7 @@ def test_full_correct_target_incorrect_head_leak(spec, state):
|
|||
|
||||
@with_phases([PHASE0, PHASE1])
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_half_incorrect_target_incorrect_head_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_fraction_incorrect(
|
||||
spec, state,
|
||||
|
@ -125,7 +125,7 @@ def test_full_half_incorrect_target_incorrect_head_leak(spec, state):
|
|||
|
||||
@with_phases([PHASE0, PHASE1])
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_half_incorrect_target_correct_head_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_fraction_incorrect(
|
||||
spec, state,
|
||||
|
@ -137,20 +137,20 @@ def test_full_half_incorrect_target_correct_head_leak(spec, state):
|
|||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active()
|
||||
@leaking()
|
||||
def test_full_random_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_random(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active(epochs=5)
|
||||
@leaking(epochs=5)
|
||||
def test_full_random_five_epoch_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_random(spec, state)
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@spec_state_test
|
||||
@inactivity_penalty_active(epochs=10)
|
||||
@leaking(epochs=10)
|
||||
def test_full_random_ten_epoch_leak(spec, state):
|
||||
yield from rewards_helpers.run_test_full_random(spec, state)
|
||||
|
|
Loading…
Reference in New Issue