Rename `build_shard_transitions_till_slot` to `get_shard_transitions`

This commit is contained in:
Hsiao-Wei Wang 2020-06-08 18:15:14 +08:00
parent a4cc189f2b
commit 7e67aaeb35
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
4 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ from eth2spec.test.context import PHASE0, spec_state_test, with_all_phases_excep
from eth2spec.test.helpers.attestations import get_valid_on_time_attestation
from eth2spec.test.helpers.shard_block import (
build_shard_block,
build_shard_transitions_till_slot,
get_shard_transitions,
get_committee_index_of_shard,
)
from eth2spec.test.helpers.fork_choice import add_block_to_store, get_anchor_root
@ -69,7 +69,7 @@ def apply_shard_and_beacon(spec, state, store, shard_store, shard_blocks_buffer)
# Sanity check `get_pending_shard_blocks` function
check_pending_shard_blocks(spec, store, shard_store, shard_blocks_buffer)
# Use temporary next state to get ShardTransition of shard block
shard_transitions = build_shard_transitions_till_slot(
shard_transitions = get_shard_transitions(
spec,
state,
shard_blocks={shard: shard_blocks_buffer},

View File

@ -52,7 +52,7 @@ def build_shard_block(spec,
return signed_block
def build_shard_transitions_till_slot(spec, parent_beacon_state, shard_blocks):
def get_shard_transitions(spec, parent_beacon_state, shard_blocks):
shard_transitions = [spec.ShardTransition()] * spec.MAX_SHARDS
on_time_slot = parent_beacon_state.slot + 1
for shard, blocks in shard_blocks.items():

View File

@ -7,7 +7,7 @@ from eth2spec.test.helpers.attestations import get_valid_on_time_attestation
from eth2spec.test.helpers.shard_transitions import run_shard_transitions_processing
from eth2spec.test.helpers.shard_block import (
build_shard_block,
build_shard_transitions_till_slot,
get_shard_transitions,
)
from eth2spec.test.helpers.state import transition_to, transition_to_valid_shard_slot, next_slot
@ -24,7 +24,7 @@ def run_basic_crosslink_tests(spec, state, target_len_offset_slot, valid=True):
body = b'\x56' * spec.MAX_SHARD_BLOCK_SIZE
shard_block = build_shard_block(spec, state, shard, body=body, slot=state.slot, signed=True)
shard_blocks = [shard_block]
shard_transitions = build_shard_transitions_till_slot(
shard_transitions = get_shard_transitions(
spec,
state,
shard_blocks={shard: shard_blocks},

View File

@ -9,7 +9,7 @@ from eth2spec.test.helpers.attestations import get_valid_on_time_attestation
from eth2spec.test.helpers.block import build_empty_block
from eth2spec.test.helpers.shard_block import (
build_shard_block,
build_shard_transitions_till_slot,
get_shard_transitions,
)
from eth2spec.test.helpers.state import state_transition_and_sign_block, transition_to_valid_shard_slot, transition_to
@ -21,7 +21,7 @@ def run_beacon_block_with_shard_blocks(spec, state, target_len_offset_slot, comm
shard_block = build_shard_block(spec, state, shard, body=body, slot=state.slot, signed=True)
shard_blocks: Dict[spec.Shard, Sequence[spec.SignedShardBlock]] = {shard: [shard_block]}
shard_transitions = build_shard_transitions_till_slot(spec, state, shard_blocks)
shard_transitions = get_shard_transitions(spec, state, shard_blocks)
attestations = [
get_valid_on_time_attestation(
spec,