Merge pull request #1885 from paulhauner/patch-26

Fork choice: minor formatting change
This commit is contained in:
Danny Ryan 2020-06-13 15:51:03 -05:00 committed by GitHub
commit df9b5f18a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -342,8 +342,9 @@ def on_tick(store: Store, time: uint64) -> None:
```python ```python
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 # Parent block must be known
assert block.parent_root in store.block_states assert block.parent_root in store.block_states
# Make a copy of the state to avoid mutability issues
pre_state = store.block_states[block.parent_root].copy() pre_state = store.block_states[block.parent_root].copy()
# 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