Fix `disable_process_reveal_deadlines` decorator: should have set it back to the spec function for other test cases afterwards
This commit is contained in:
parent
e57e1407a2
commit
fd4e7dde94
|
@ -264,6 +264,24 @@ def bls_switch(fn):
|
|||
return entry
|
||||
|
||||
|
||||
def disable_process_reveal_deadlines(fn):
|
||||
"""
|
||||
Decorator to make a function execute with `process_reveal_deadlines` OFF.
|
||||
This is for testing long-range epochs transition without considering the reveal-deadline slashing effect.
|
||||
"""
|
||||
def entry(*args, spec: Spec, **kw):
|
||||
if hasattr(spec, 'process_reveal_deadlines'):
|
||||
old_state = spec.process_reveal_deadlines
|
||||
spec.process_reveal_deadlines = lambda state: None
|
||||
|
||||
yield from fn(*args, spec=spec, **kw)
|
||||
|
||||
if hasattr(spec, 'process_reveal_deadlines'):
|
||||
spec.process_reveal_deadlines = old_state
|
||||
|
||||
return with_meta_tags({'reveal_deadlines_setting': 1})(entry)
|
||||
|
||||
|
||||
def with_all_phases(fn):
|
||||
"""
|
||||
A decorator for running a test with every phase
|
||||
|
@ -321,14 +339,6 @@ def with_phases(phases, other_phases=None):
|
|||
return decorator
|
||||
|
||||
|
||||
def disable_process_reveal_deadlines(fn):
|
||||
def entry(*args, spec: Spec, **kw):
|
||||
if hasattr(spec, 'process_reveal_deadlines'):
|
||||
spec.process_reveal_deadlines = lambda state: None
|
||||
return fn(*args, spec=spec, **kw)
|
||||
return with_meta_tags({'reveal_deadlines_setting': 1})(entry)
|
||||
|
||||
|
||||
def with_configs(configs, reason=None):
|
||||
def decorator(fn):
|
||||
def wrapper(*args, spec: Spec, **kw):
|
||||
|
|
Loading…
Reference in New Issue