Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- genEpochNumber ∷ Gen EpochNumber
- genSlotNumber ∷ Gen SlotNumber
- genEpochSlots ∷ Gen EpochSlots
- genWithEpochSlots ∷ (ProtocolMagicId → EpochSlots → Gen a) → ProtocolMagicId → EpochSlots → Gen (WithEpochSlots a)
- genSlotCount ∷ Gen SlotCount
- genEpochAndSlotCount ∷ EpochSlots → Gen EpochAndSlotCount
- genConsistentEpochAndSlotCountEpochSlots ∷ Gen (EpochAndSlotCount, EpochSlots)
- feedPMEpochSlots ∷ (ProtocolMagicId → EpochSlots → Gen a) → Gen a
Documentation
genEpochSlots ∷ Gen 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 ∷ (ProtocolMagicId → EpochSlots → Gen a) → ProtocolMagicId → EpochSlots → Gen (WithEpochSlots a) Source #
Generate a value wrapped on a WithEpochSlots
context, using the given
generator functions, and its arguments
feedPMEpochSlots ∷ (ProtocolMagicId → EpochSlots → Gen a) → Gen a Source #