From c5b169bd62bd42a0dd5bcbf6e98e0175c9afa82c Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Fri, 15 Oct 2021 16:15:37 -0600 Subject: [PATCH] fix issue with mutation in test generation --- tests/core/pyspec/eth2spec/test/helpers/fork_transition.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py index fbed08f09..310c4a8d2 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py @@ -288,7 +288,7 @@ def run_transition_with_operation(state, # after the fork if operation_type == OperationType.DEPOSIT: - _transition_until_active(post_spec, state, post_tag, blocks, selected_validator_index) + state = _transition_until_active(post_spec, state, post_tag, blocks, selected_validator_index) else: # avoid using the slashed validators as block proposers ignoring_proposers = [selected_validator_index] if is_slashing_operation else None @@ -332,3 +332,5 @@ def _transition_until_active(post_spec, state, post_tag, blocks, validator_index state_transition_across_slots(post_spec, state, to_slot, block_filter=only_at(to_slot)) ]) assert post_spec.is_active_validator(state.validators[validator_index], post_spec.get_current_epoch(state)) + + return state