mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-31 21:05:24 +00:00
Combine the conflicting handler names
This commit is contained in:
parent
fea3702b3d
commit
dcdbff0728
@ -109,3 +109,24 @@ def run_state_test_generators(runner_name: str,
|
||||
preset_name=preset_name,
|
||||
all_mods=all_mods,
|
||||
))
|
||||
|
||||
|
||||
def combine_mods(dict_1, dict_2):
|
||||
"""
|
||||
Return the merged dicts, where the result value would be a list of the values from two dicts.
|
||||
"""
|
||||
# The duplicate dict_1 items would be ignored here.
|
||||
dict_3 = {**dict_1, **dict_2}
|
||||
|
||||
intersection = list(dict_1.keys() & dict_2.keys())
|
||||
for key in intersection:
|
||||
# To list
|
||||
if not isinstance(dict_3[key], List):
|
||||
dict_3[key] = [dict_3[key], ]
|
||||
# Append dict_1 value to list
|
||||
if isinstance(dict_1[key], List):
|
||||
dict_3[key] += dict_1[key]
|
||||
else:
|
||||
dict_3[key].append(dict_1[key])
|
||||
|
||||
return dict_3
|
||||
|
@ -11,7 +11,7 @@ from eth2spec.test.context import (
|
||||
|
||||
@with_merge_and_later
|
||||
@spec_state_test
|
||||
def test_empty_block_transition(spec, state):
|
||||
def test_empty_block_transition_no_tx(spec, state):
|
||||
yield 'pre', state
|
||||
|
||||
block = build_empty_block_for_next_slot(spec, state)
|
||||
|
@ -1,4 +1,4 @@
|
||||
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
|
||||
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods
|
||||
from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE
|
||||
|
||||
|
||||
@ -7,14 +7,15 @@ if __name__ == "__main__":
|
||||
'initialization',
|
||||
'validity',
|
||||
]}
|
||||
altair_mods = phase_0_mods
|
||||
|
||||
# we have new unconditional lines in `initialize_beacon_state_from_eth1` and we want to test it
|
||||
merge_mods = {
|
||||
**{key: 'eth2spec.test.merge.genesis.test_' + key for key in [
|
||||
'initialization',
|
||||
]},
|
||||
**altair_mods,
|
||||
}
|
||||
altair_mods = phase_0_mods
|
||||
|
||||
_new_merge_mods = {key: 'eth2spec.test.merge.genesis.test_' + key for key in [
|
||||
'initialization',
|
||||
]}
|
||||
merge_mods = combine_mods(_new_merge_mods, altair_mods)
|
||||
|
||||
all_mods = {
|
||||
PHASE0: phase_0_mods,
|
||||
ALTAIR: altair_mods,
|
||||
|
@ -1,5 +1,5 @@
|
||||
from eth2spec.test.helpers.constants import PHASE0, ALTAIR, MERGE
|
||||
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators
|
||||
from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@ -7,12 +7,16 @@ if __name__ == "__main__":
|
||||
'blocks',
|
||||
'slots',
|
||||
]}
|
||||
altair_mods = {**{key: 'eth2spec.test.altair.sanity.test_' + key for key in [
|
||||
|
||||
_new_altair_mods = {key: 'eth2spec.test.altair.sanity.test_' + key for key in [
|
||||
'blocks',
|
||||
]}, **phase_0_mods}
|
||||
merge_mods = {**{key: 'eth2spec.test.merge.sanity.test_' + key for key in [
|
||||
]}
|
||||
altair_mods = combine_mods(_new_altair_mods, phase_0_mods)
|
||||
|
||||
_new_merge_mods = {key: 'eth2spec.test.merge.sanity.test_' + key for key in [
|
||||
'blocks',
|
||||
]}, **altair_mods}
|
||||
]}
|
||||
merge_mods = combine_mods(_new_merge_mods, altair_mods)
|
||||
|
||||
all_mods = {
|
||||
PHASE0: phase_0_mods,
|
||||
|
Loading…
x
Reference in New Issue
Block a user