Update specs/core/0_beacon-chain.md

Co-Authored-By: djrtwo <dannyjryan@gmail.com>
This commit is contained in:
Hsiao-Wei Wang 2019-04-14 22:12:39 +10:00 committed by GitHub
parent 0656817346
commit 3c8d1b23a5
1 changed files with 1 additions and 0 deletions

View File

@ -691,6 +691,7 @@ def slot_to_epoch(slot: Slot) -> Epoch:
def get_previous_epoch(state: BeaconState) -> Epoch:
"""`
Return the previous epoch of the given ``state``.
Return the current epoch if it's genesis epoch.
"""
current_epoch = get_current_epoch(state)
return (current_epoch - 1) if current_epoch > GENESIS_EPOCH else current_epoch