mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 09:35:00 -05:00
Index from GENESIS_SLOT in compute_time_at_slot
Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
@@ -163,7 +163,8 @@ def compute_randao_mix(state: BeaconState, randao_reveal: BLSSignature) -> Bytes
|
||||
|
||||
```python
|
||||
def compute_time_at_slot(state: BeaconState, slot: Slot) -> uint64:
|
||||
return uint64(state.genesis_time + slot * SECONDS_PER_SLOT)
|
||||
slots_since_genesis = slot - GENESIS_SLOT
|
||||
return uint64(state.genesis_time + slots_since_genesis * SECONDS_PER_SLOT)
|
||||
```
|
||||
|
||||
### Beacon state accessors
|
||||
|
||||
Reference in New Issue
Block a user