mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-19 15:11:05 +00:00
fix cache for config change during runtime
This commit is contained in:
parent
75a0d60eb3
commit
97e54b85d6
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user