Rename `build_empty_shard_block` to `build_shard_block`

This commit is contained in:
Hsiao-Wei Wang 2020-04-13 18:23:01 +08:00
parent afa12caf1f
commit e645d6b5fa
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 8 additions and 8 deletions

View File

@ -15,12 +15,12 @@ def sign_shard_block(spec, beacon_state, shard, block, proposer_index=None):
block.signature = bls.Sign(privkey, signing_root) block.signature = bls.Sign(privkey, signing_root)
def build_empty_shard_block(spec, def build_shard_block(spec,
beacon_state, beacon_state,
shard, shard,
slot, slot,
body=None, body=None,
signed=False): signed=False):
shard_state = beacon_state.shard_states[shard] shard_state = beacon_state.shard_states[shard]
if slot is None: if slot is None:
slot = shard_state.slot slot = shard_state.slot

View File

@ -9,7 +9,7 @@ from eth2spec.test.helpers.attestations import (
from eth2spec.test.helpers.crosslinks import ( from eth2spec.test.helpers.crosslinks import (
run_crosslinks_processing, run_crosslinks_processing,
) )
from eth2spec.test.helpers.shard_block import build_empty_shard_block from eth2spec.test.helpers.shard_block import build_shard_block
from eth2spec.test.helpers.state import next_epoch, next_slot from eth2spec.test.helpers.state import next_epoch, next_slot
@ -24,7 +24,7 @@ def test_basic_crosslinks(spec, state):
committee_index = spec.CommitteeIndex(0) committee_index = spec.CommitteeIndex(0)
shard = spec.compute_shard_from_committee_index(state, committee_index, state.slot) shard = spec.compute_shard_from_committee_index(state, committee_index, state.slot)
shard_block = build_empty_shard_block(spec, state, shard, body=b'\x12' * 10, slot=state.slot, signed=True) shard_block = build_shard_block(spec, state, shard, body=b'\x12' * 10, slot=state.slot, signed=True)
shard_blocks = [shard_block] shard_blocks = [shard_block]
next_slot(spec, state) next_slot(spec, state)