cardano-ledger-byron-test-1.5.2.0: Test helpers from cardano-ledger exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Chain.Slotting.Gen

Synopsis

Documentation

genEpochSlotsGen EpochSlots Source #

Generator for slots-per-epoch. This will generate a positive number of slots per-epoch, and it will have an upper bound of maxBound :: Word16 = 2^16. The reason for this upper bound is that when converting a slot number (which is an absolute value) to a pair of epoch and slot-count, this slot-count, which represents a local index of a slot within the epoch and is represented using a Word16, is calculated taking the reminder of dividing the slot number by the number of slots-per-epoch (EpochSlots). So if the generated epoch would be greater than 2^16 we couldn't guarantee that the local-index would fit inside its representation.

genWithEpochSlots ∷ (ProtocolMagicIdEpochSlotsGen a) → ProtocolMagicIdEpochSlotsGen (WithEpochSlots a) Source #

Generate a value wrapped on a WithEpochSlots context, using the given generator functions, and its arguments