Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype SlotNo = SlotNo { }
-
newtype
Duration
=
Duration
{
- unDuration :: Word64
- (-*) :: SlotNo -> SlotNo -> Duration
- (+*) :: SlotNo -> Duration -> SlotNo
- (*-) :: SlotNo -> Duration -> SlotNo
- newtype EpochNo = EpochNo { }
- newtype EpochSize = EpochSize { }
- data EpochInfo (m :: Type -> Type )
- newtype BlockNo = BlockNo { }
- epochInfoEpoch :: HasCallStack => EpochInfo Identity -> SlotNo -> ShelleyBase EpochNo
- epochInfoFirst :: HasCallStack => EpochInfo Identity -> EpochNo -> ShelleyBase SlotNo
- epochInfoSize :: HasCallStack => EpochInfo Identity -> EpochNo -> ShelleyBase EpochSize
Documentation
The 0-based index for the Ourboros time slot.
Instances
Bounded SlotNo | |
Enum SlotNo | |
Defined in Cardano.Slotting.Slot succ :: SlotNo -> SlotNo Source # pred :: SlotNo -> SlotNo Source # toEnum :: Int -> SlotNo Source # fromEnum :: SlotNo -> Int Source # enumFrom :: SlotNo -> [ SlotNo ] Source # enumFromThen :: SlotNo -> SlotNo -> [ SlotNo ] Source # enumFromTo :: SlotNo -> SlotNo -> [ SlotNo ] Source # enumFromThenTo :: SlotNo -> SlotNo -> SlotNo -> [ SlotNo ] Source # |
|
Eq SlotNo | |
Num SlotNo | |
Defined in Cardano.Slotting.Slot |
|
Ord SlotNo | |
Show SlotNo | |
Generic SlotNo | |
NFData SlotNo | |
Defined in Cardano.Slotting.Slot |
|
ToJSON SlotNo | |
FromJSON SlotNo | |
ToCBOR SlotNo | |
FromCBOR SlotNo | |
NoThunks SlotNo | |
Serialise SlotNo | |
type Rep SlotNo | |
Defined in Cardano.Slotting.Slot |
Instances
An epoch, i.e. the number of the epoch.
Instances
Enum EpochNo | |
Defined in Cardano.Slotting.Slot succ :: EpochNo -> EpochNo Source # pred :: EpochNo -> EpochNo Source # toEnum :: Int -> EpochNo Source # fromEnum :: EpochNo -> Int Source # enumFrom :: EpochNo -> [ EpochNo ] Source # enumFromThen :: EpochNo -> EpochNo -> [ EpochNo ] Source # enumFromTo :: EpochNo -> EpochNo -> [ EpochNo ] Source # enumFromThenTo :: EpochNo -> EpochNo -> EpochNo -> [ EpochNo ] Source # |
|
Eq EpochNo | |
Num EpochNo | |
Defined in Cardano.Slotting.Slot |
|
Ord EpochNo | |
Defined in Cardano.Slotting.Slot |
|
Show EpochNo | |
Generic EpochNo | |
NFData EpochNo | |
Defined in Cardano.Slotting.Slot |
|
ToJSON EpochNo | |
FromJSON EpochNo | |
ToCBOR EpochNo | |
FromCBOR EpochNo | |
NoThunks EpochNo | |
Serialise EpochNo | |
type Rep EpochNo | |
Defined in Cardano.Slotting.Slot |
Instances
data EpochInfo (m :: Type -> Type ) Source #
Information about epochs
Different epochs may have different sizes and different slot lengths. This
information is encapsulated by
EpochInfo
. It is parameterized over a monad
m
because the information about how long each epoch is may depend on
information derived from the blockchain itself. It ultimately requires acess
to state, and so either uses the monad for that or uses the monad to reify
failure due to cached state information being too stale for the current
query.
The 0-based index of the block in the blockchain. BlockNo is <= SlotNo and is only equal at slot N if there is a block for every slot where N <= SlotNo.
Instances
Bounded BlockNo | |
Enum BlockNo | |
Defined in Cardano.Slotting.Block succ :: BlockNo -> BlockNo Source # pred :: BlockNo -> BlockNo Source # toEnum :: Int -> BlockNo Source # fromEnum :: BlockNo -> Int Source # enumFrom :: BlockNo -> [ BlockNo ] Source # enumFromThen :: BlockNo -> BlockNo -> [ BlockNo ] Source # enumFromTo :: BlockNo -> BlockNo -> [ BlockNo ] Source # enumFromThenTo :: BlockNo -> BlockNo -> BlockNo -> [ BlockNo ] Source # |
|
Eq BlockNo | |
Num BlockNo | |
Defined in Cardano.Slotting.Block |
|
Ord BlockNo | |
Defined in Cardano.Slotting.Block |
|
Show BlockNo | |
Generic BlockNo | |
NFData BlockNo | |
Defined in Cardano.Slotting.Block |
|
ToCBOR BlockNo | |
FromCBOR BlockNo | |
NoThunks BlockNo | |
Serialise BlockNo | |
type Rep BlockNo | |
Defined in Cardano.Slotting.Block |
epochInfoEpoch :: HasCallStack => EpochInfo Identity -> SlotNo -> ShelleyBase EpochNo Source #
epochInfoFirst :: HasCallStack => EpochInfo Identity -> EpochNo -> ShelleyBase SlotNo Source #
epochInfoSize :: HasCallStack => EpochInfo Identity -> EpochNo -> ShelleyBase EpochSize Source #