From 9fbf75139dee9df9f4142db87a94fce6b4c3a17a Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 21 Dec 2023 22:55:46 +0800 Subject: [PATCH] Add assertion to ensure eval usage is fine --- tests/core/pyspec/eth2spec/test/helpers/fork_transition.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py index 93879512d..329fbdbda 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py @@ -12,6 +12,7 @@ from eth2spec.test.helpers.block import ( from eth2spec.test.helpers.bls_to_execution_changes import get_signed_address_change from eth2spec.test.helpers.constants import ( PHASE0, + POST_FORK_OF, PREVIOUS_FORK_OF, ) from eth2spec.test.helpers.deposits import ( @@ -143,6 +144,9 @@ def state_transition_across_slots_with_ignoring_proposers(spec, def get_upgrade_fn(spec, fork): + # pylint: disable=unused-argument + # NOTE: `spec` is used for the `eval` call + assert fork in POST_FORK_OF.values() try: # TODO: make all upgrade_to_* function names consistent? fn = eval(f"spec.upgrade_to_{fork}")