ouroboros-consensus-shelley-0.1.0.0: Shelley ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Protocol.Util

Description

Assorted utility functions for Shelley protocol integration.

In particular, various things we need for integration with the delegation package from cardano-ledger-specs.

Synopsis

Documentation

isNewEpoch Source #

Arguments

:: EpochInfo Identity 
-> WithOrigin SlotNo

Slot we are comparing a new epoch against

-> SlotNo

Slot we want to check

-> Bool 

Verify whether a slot represents a change to a new epoch with regard to some other slot.

PRECONDITION: the two slots must be in the same era.

firstSlotOfEpochOfSlot :: EpochInfo Identity -> SlotNo -> SlotNo Source #

Return the first slot in the epoch of the given slot.