Get rid of compute_state_by_epoch_processing_to

This commit is contained in:
Mikhail Kalinin 2024-08-09 15:51:05 +06:00
parent f4e3908801
commit 23a669dc29
2 changed files with 7 additions and 10 deletions

View File

@ -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")

View File

@ -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