mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-03 07:05:05 -05:00
fix assert conditions in get_block_hash
This commit is contained in:
@@ -902,7 +902,8 @@ def get_block_root(state: BeaconState,
|
||||
"""
|
||||
Returns the block root at a recent ``slot``.
|
||||
"""
|
||||
assert slot > state.slot - LATEST_BLOCK_ROOTS_LENGTH
|
||||
assert state.slot <= slot + LATEST_BLOCK_ROOTS_LENGTH
|
||||
assert slot < state.slot
|
||||
return state.latest_block_roots[slot % LATEST_BLOCK_ROOTS_LENGTH]
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user