valid==True for `run_successful_crosslink_tests` helper

This commit is contained in:
Hsiao-Wei Wang 2020-06-19 23:07:39 +08:00
parent b8caa6ee85
commit 80c6c0b5f1
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
1 changed files with 13 additions and 14 deletions

View File

@ -43,7 +43,7 @@ def get_attestations_and_shard_transitions(spec, state, shard_block_dict):
return attestations, shard_transitions return attestations, shard_transitions
def run_successful_crosslink_tests(spec, state, target_len_offset_slot, valid=True): def run_successful_crosslink_tests(spec, state, target_len_offset_slot):
state, shard, target_shard_slot = get_initial_env(spec, state, target_len_offset_slot) state, shard, target_shard_slot = get_initial_env(spec, state, target_len_offset_slot)
init_slot = state.slot init_slot = state.slot
@ -72,9 +72,8 @@ def run_successful_crosslink_tests(spec, state, target_len_offset_slot, valid=Tr
pre_gasprice = state.shard_states[shard].gasprice pre_gasprice = state.shard_states[shard].gasprice
pre_shard_states = state.shard_states.copy() pre_shard_states = state.shard_states.copy()
yield from run_shard_transitions_processing(spec, state, shard_transitions, attestations, valid=valid) yield from run_shard_transitions_processing(spec, state, shard_transitions, attestations)
if valid:
for index, shard_state in enumerate(state.shard_states): for index, shard_state in enumerate(state.shard_states):
if index == shard: if index == shard:
assert shard_state != pre_shard_states[index] assert shard_state != pre_shard_states[index]