Skip to content

Commit 7259a6c

Browse files
authored
Merge pull request #3878 from mkalinin/remove-compute_state_by_epoch_processing_to
Get rid of compute_state_by_epoch_processing_to
2 parents ca04b1e + 23a669d commit 7259a6c

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

tests/core/pyspec/eth2spec/test/electra/epoch_processing/test_process_pending_consolidations.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from eth2spec.test.helpers.epoch_processing import (
22
run_epoch_processing_with,
3-
compute_state_by_epoch_processing_to,
3+
run_epoch_processing_to,
44
)
55
from eth2spec.test.context import (
66
spec_state_test,
@@ -219,7 +219,8 @@ def test_pending_consolidation_future_epoch(spec, state):
219219
next_epoch_with_full_participation(spec, state)
220220

221221
# Obtain state before the call to process_pending_consolidations
222-
state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_consolidations")
222+
state_before_consolidation = state.copy()
223+
run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations")
223224

224225
yield from run_epoch_processing_with(spec, state, "process_pending_consolidations")
225226

@@ -270,7 +271,8 @@ def test_pending_consolidation_compounding_creds(spec, state):
270271
next_epoch_with_full_participation(spec, state)
271272

272273
# Obtain state before the call to process_pending_consolidations
273-
state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_consolidations")
274+
state_before_consolidation = state.copy()
275+
run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations")
274276

275277
yield from run_epoch_processing_with(spec, state, "process_pending_consolidations")
276278

@@ -325,7 +327,8 @@ def test_pending_consolidation_with_pending_deposit(spec, state):
325327
next_epoch_with_full_participation(spec, state)
326328

327329
# Obtain state before the call to process_pending_balance_deposits
328-
state_before_consolidation = compute_state_by_epoch_processing_to(spec, state, "process_pending_balance_deposits")
330+
state_before_consolidation = state.copy()
331+
run_epoch_processing_to(spec, state_before_consolidation, "process_pending_consolidations")
329332

330333
yield from run_epoch_processing_with(spec, state, "process_pending_consolidations")
331334

tests/core/pyspec/eth2spec/test/helpers/epoch_processing.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,3 @@ def run_epoch_processing_with(spec, state, process_name: str):
7474
yield 'pre', state
7575
getattr(spec, process_name)(state)
7676
yield 'post', state
77-
78-
79-
def compute_state_by_epoch_processing_to(spec, state, process_name: str):
80-
state_copy = state.copy()
81-
run_epoch_processing_to(spec, state_copy, process_name)
82-
return state_copy

0 commit comments

Comments
 (0)