From 97e54b85d6c4c6663f97e4a9e3d51b10c1945300 Mon Sep 17 00:00:00 2001 From: protolambda Date: Tue, 19 May 2020 02:46:27 +0200 Subject: [PATCH] fix cache for config change during runtime --- tests/core/pyspec/eth2spec/test/context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/context.py b/tests/core/pyspec/eth2spec/test/context.py index 303f680fb..93b474517 100644 --- a/tests/core/pyspec/eth2spec/test/context.py +++ b/tests/core/pyspec/eth2spec/test/context.py @@ -78,8 +78,9 @@ def with_custom_state(balances_fn: Callable[[Any], Sequence[int]], def deco(fn): def entry(*args, spec: Spec, phases: SpecForks, **kw): - # Use fork and file path to make a key for th - key = (spec.fork, spec.__file__, balances_fn, threshold_fn) + # make a key for the state + # genesis fork version separates configs during test-generation runtime. + key = (spec.fork, spec.GENESIS_FORK_VERSION, spec.__file__, balances_fn, threshold_fn) global _custom_state_cache_dict if key not in _custom_state_cache_dict: state = _prepare_state(balances_fn, threshold_fn, spec, phases)