From 23a669dc29953c7be97a9d962c0e99bdebda0cef Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Fri, 9 Aug 2024 15:51:05 +0600 Subject: [PATCH] Get rid of compute_state_by_epoch_processing_to --- .../test_process_pending_consolidations.py | 11 +++++++---- .../pyspec/eth2spec/test/helpers/epoch_processing.py | 6 ------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py index d75014983..14e151e2e 100644 --- a/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py +++ b/tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py @@ -1,6 +1,6 @@ from eth2spec.test.helpers.epoch_processing import ( run_epoch_processing_with, - compute_state_by_epoch_processing_to, + run_epoch_processing_to, ) from eth2spec.test.context import ( spec_state_test, @@ -219,7 +219,8 @@ def test_pending_consolidation_future_epoch(spec, state): next_epoch_with_full_participation(spec, state) # Obtain state before the call to process_pending_consolidations - state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_consolidations") + state_before_consolidation = state.copy() + run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations") yield from run_epoch_processing_with(spec, state, "process_pending_consolidations") @@ -270,7 +271,8 @@ def test_pending_consolidation_compounding_creds(spec, state): next_epoch_with_full_participation(spec, state) # Obtain state before the call to process_pending_consolidations - state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_consolidations") + state_before_consolidation = state.copy() + run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations") yield from run_epoch_processing_with(spec, state, "process_pending_consolidations") @@ -325,7 +327,8 @@ def test_pending_consolidation_with_pending_deposit(spec, state): next_epoch_with_full_participation(spec, state) # Obtain state before the call to process_pending_balance_deposits - state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_balance_deposits") + state_before_consolidation = state.copy() + run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations") yield from run_epoch_processing_with(spec, state, "process_pending_consolidations") diff --git a/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py b/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py index 80302e111..c2b7af5a4 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py +++ b/tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py @@ -74,9 +74,3 @@ def run_epoch_processing_with(spec, state, process_name: str): yield 'pre', state getattr(spec, process_name)(state) yield 'post', state - - -def compute_state_by_epoch_processing_to(spec, state, process_name: str): - state_copy = state.copy() - run_epoch_processing_to(spec, state_copy, process_name) - return state_copy