From 35bf3b5290bed6bbae03ca62d798766dbcd3791c Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 18 Jun 2020 23:20:24 +0800 Subject: [PATCH] Refactor `validate_attestation` Co-authored-by: Danny Ryan --- specs/phase1/beacon-chain.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index f63654182..27f317bc1 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -765,9 +765,8 @@ def validate_attestation(state: BeaconState, attestation: Attestation) -> None: # Correct parent block root assert data.beacon_block_root == get_block_root_at_slot(state, compute_previous_slot(state.slot)) # Correct shard number - assert attestation.data.shard == compute_shard_from_committee_index( - state, attestation.data.index, attestation.data.slot - ) + shard = compute_shard_from_committee_index(state, attestation.data.index, attestation.data.slot) + assert attestation.data.shard == shard # Type 2: no shard transition else: # Ensure delayed attestation