Skip to content

Commit 9fbf751

Browse files
committed
Add assertion to ensure eval usage is fine
1 parent b123f9f commit 9fbf751

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from eth2spec.test.helpers.bls_to_execution_changes import get_signed_address_change
1313
from eth2spec.test.helpers.constants import (
1414
PHASE0,
15+
POST_FORK_OF,
1516
PREVIOUS_FORK_OF,
1617
)
1718
from eth2spec.test.helpers.deposits import (
@@ -143,6 +144,9 @@ def state_transition_across_slots_with_ignoring_proposers(spec,
143144

144145

145146
def get_upgrade_fn(spec, fork):
147+
# pylint: disable=unused-argument
148+
# NOTE: `spec` is used for the `eval` call
149+
assert fork in POST_FORK_OF.values()
146150
try:
147151
# TODO: make all upgrade_to_* function names consistent?
148152
fn = eval(f"spec.upgrade_to_{fork}")

0 commit comments

Comments
 (0)