From fbcc2a4870f230a9744456702ca6ef5d48ff4e50 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Fri, 18 Oct 2019 12:05:43 +0900 Subject: [PATCH] fix comment re: proto --- specs/core/1_shard-data-chains.md | 2 +- test_libs/pyspec/eth2spec/test/helpers/block.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specs/core/1_shard-data-chains.md b/specs/core/1_shard-data-chains.md index 477dce44f..6edc5daba 100644 --- a/specs/core/1_shard-data-chains.md +++ b/specs/core/1_shard-data-chains.md @@ -106,8 +106,8 @@ This document describes the shard transition function (data layer only) and the ### `Crosslink` ```python +# Crosslink is a placeholder to appease the build script until phase 1 is reworked class Crosslink(Container): - # STUB: placeholder data structure while reworking phase 0 shard: Shard ``` diff --git a/test_libs/pyspec/eth2spec/test/helpers/block.py b/test_libs/pyspec/eth2spec/test/helpers/block.py index 2682a0c82..779f2e1cf 100644 --- a/test_libs/pyspec/eth2spec/test/helpers/block.py +++ b/test_libs/pyspec/eth2spec/test/helpers/block.py @@ -14,7 +14,7 @@ def sign_block(spec, state, block, proposer_index=None): if block.slot == state.slot: proposer_index = spec.get_beacon_proposer_index(state) else: - if spec.compute_epoch_of_slot(state.slot) + 1 > spec.compute_epoch_of_slot(block.slot): + if spec.compute_epoch_at_slot(state.slot) + 1 > spec.compute_epoch_at_slot(block.slot): print("warning: block slot far away, and no proposer index manually given." " Signing block is slow due to transition for proposer index calculation.") # use stub state to get proposer index of future slot @@ -26,10 +26,10 @@ def sign_block(spec, state, block, proposer_index=None): block.body.randao_reveal = bls_sign( privkey=privkey, - message_hash=hash_tree_root(spec.compute_epoch_of_slot(block.slot)), + message_hash=hash_tree_root(spec.compute_epoch_at_slot(block.slot)), domain=spec.get_domain( state, - message_epoch=spec.compute_epoch_of_slot(block.slot), + message_epoch=spec.compute_epoch_at_slot(block.slot), domain_type=spec.DOMAIN_RANDAO, ) ) @@ -39,7 +39,7 @@ def sign_block(spec, state, block, proposer_index=None): domain=spec.get_domain( state, spec.DOMAIN_BEACON_PROPOSER, - spec.compute_epoch_of_slot(block.slot))) + spec.compute_epoch_at_slot(block.slot))) def apply_empty_block(spec, state):