From 3a6da9839a64a7edc951bef541b47a65554bfed8 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Sun, 3 Feb 2019 14:27:09 +0100 Subject: [PATCH] Added a note for underflow. Thanks Hsiao Wei! : ) Co-Authored-By: terenc3t --- specs/core/0_beacon-chain.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 5c1d158b5..b8815388d 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -646,6 +646,7 @@ def slot_to_epoch(slot: SlotNumber) -> EpochNumber: def get_previous_epoch(state: BeaconState) -> EpochNumber: """` Return the previous epoch of the given ``state``. + If the current epoch is ``GENESIS_EPOCH``, return ``GENESIS_EPOCH``. """ if slot_to_epoch(state.slot) > GENESIS_EPOCH: return slot_to_epoch(state.slot) - 1