Tidy, add comment

This commit is contained in:
Paul Hauner 2020-06-11 11:51:18 +10:00 committed by GitHub
parent c3a69bfd9c
commit a1a75a38fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,8 +343,9 @@ def on_tick(store: Store, time: uint64) -> None:
def on_block(store: Store, signed_block: SignedBeaconBlock) -> None: def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
block = signed_block.message block = signed_block.message
# Make a copy of the state to avoid mutability issues # Make a copy of the state to avoid mutability issues
assert block.parent_root in store.block_states
pre_state = store.block_states[block.parent_root].copy() pre_state = store.block_states[block.parent_root].copy()
# Parent block must be known
assert block.parent_root in store.block_states
# Blocks cannot be in the future. If they are, their consideration must be delayed until the are in the past. # Blocks cannot be in the future. If they are, their consideration must be delayed until the are in the past.
assert get_current_slot(store) >= block.slot assert get_current_slot(store) >= block.slot
# Add new block to the store # Add new block to the store