From 8e815dd3f76024bc248c52352dc0a9a0abc91337 Mon Sep 17 00:00:00 2001 From: Justin Drake Date: Mon, 15 Mar 2021 11:25:59 +0000 Subject: [PATCH] revert rename of to --- .../pyspec/eth2spec/test/helpers/rewards.py | 2 +- .../test_process_rewards_and_penalties.py | 10 ++--- .../eth2spec/test/phase0/rewards/test_leak.py | 38 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/helpers/rewards.py b/tests/core/pyspec/eth2spec/test/helpers/rewards.py index 3b5bd0549..8d34500b6 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/rewards.py +++ b/tests/core/pyspec/eth2spec/test/helpers/rewards.py @@ -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): diff --git a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py index 2ca20f047..f7c9b394e 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py +++ b/tests/core/pyspec/eth2spec/test/phase0/epoch_processing/test_process_rewards_and_penalties.py @@ -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) diff --git a/tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py b/tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py index 4ded4050f..b2ed6f5d8 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py +++ b/tests/core/pyspec/eth2spec/test/phase0/rewards/test_leak.py @@ -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)