Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype SlotNo = SlotNo {}
- getTheSlotOfNoReturn ∷ HasCallStack ⇒ SlotNo → ShelleyBase (EpochNo, SlotNo, EpochNo)
- newtype Duration = Duration {}
- (-*) ∷ SlotNo → SlotNo → Duration
- (+*) ∷ SlotNo → Duration → SlotNo
- (*-) ∷ SlotNo → Duration → SlotNo
- newtype EpochNo = EpochNo {}
- newtype EpochSize = EpochSize {}
- data EpochInfo (m ∷ TYPE LiftedRep → Type)
- newtype BlockNo = BlockNo {}
- epochFromSlot ∷ SlotNo → Reader Globals EpochNo
- epochInfoEpoch ∷ HasCallStack ⇒ EpochInfo Identity → SlotNo → EpochNo
- epochInfoFirst ∷ HasCallStack ⇒ EpochInfo Identity → EpochNo → SlotNo
- epochInfoSize ∷ HasCallStack ⇒ EpochInfo Identity → EpochNo → EpochSize
Documentation
The 0-based index for the Ourboros time slot.
Instances
FromJSON SlotNo | |
ToJSON SlotNo | |
Bounded SlotNo | |
Enum SlotNo | |
Generic SlotNo | |
Num SlotNo | |
Show SlotNo | |
FromCBOR SlotNo | |
ToCBOR SlotNo | |
DecCBOR SlotNo | |
EncCBOR SlotNo | |
NFData SlotNo | |
Defined in Cardano.Slotting.Slot | |
Eq SlotNo | |
Ord SlotNo | |
NoThunks SlotNo | |
Serialise SlotNo | |
type Rep SlotNo | |
Defined in Cardano.Slotting.Slot type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
getTheSlotOfNoReturn ∷ HasCallStack ⇒ SlotNo → ShelleyBase (EpochNo, SlotNo, EpochNo) Source #
Figure out a slot number that is two stability windows before the end of the next epoch. Together with the slot number we also return the current epoch number and the next epoch number.
The reason why it is called the point of no return, is because that is the point when HardForkCombinator (HFC) initiates a controlled hard fork, if there is a major protocol version update that forks into a new era.
Instances
Monoid Duration Source # | |
Semigroup Duration Source # | |
Enum Duration Source # | |
Generic Duration Source # | |
Num Duration Source # | |
Integral Duration Source # | |
Defined in Cardano.Ledger.Slot | |
Real Duration Source # | |
Defined in Cardano.Ledger.Slot toRational ∷ Duration → Rational # | |
Show Duration Source # | |
Eq Duration Source # | |
Ord Duration Source # | |
NoThunks Duration Source # | |
type Rep Duration Source # | |
An epoch, i.e. the number of the epoch.
Instances
FromJSON EpochNo | |
ToJSON EpochNo | |
Enum EpochNo | |
Defined in Cardano.Slotting.Slot | |
Generic EpochNo | |
Show EpochNo | |
FromCBOR EpochNo | |
ToCBOR EpochNo | |
DecCBOR EpochNo | |
EncCBOR EpochNo | |
NFData EpochNo | |
Defined in Cardano.Slotting.Slot | |
Eq EpochNo | |
Ord EpochNo | |
NoThunks EpochNo | |
Serialise EpochNo | |
type Rep EpochNo | |
Defined in Cardano.Slotting.Slot type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
Instances
FromJSON EpochSize | |
ToJSON EpochSize | |
Enum EpochSize | |
Generic EpochSize | |
Show EpochSize | |
FromCBOR EpochSize | |
ToCBOR EpochSize | |
DecCBOR EpochSize | |
EncCBOR EpochSize | |
NFData EpochSize | |
Defined in Cardano.Slotting.Slot | |
Eq EpochSize | |
Ord EpochSize | |
Defined in Cardano.Slotting.Slot | |
NoThunks EpochSize | |
type Rep EpochSize | |
Defined in Cardano.Slotting.Slot type Rep EpochSize = D1 ('MetaData "EpochSize" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "EpochSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
data EpochInfo (m ∷ TYPE LiftedRep → 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
FromJSON BlockNo | |
ToJSON BlockNo | |
Bounded BlockNo | |
Enum BlockNo | |
Defined in Cardano.Slotting.Block | |
Generic BlockNo | |
Num BlockNo | |
Show BlockNo | |
FromCBOR BlockNo | |
ToCBOR BlockNo | |
DecCBOR BlockNo | |
EncCBOR BlockNo | |
NFData BlockNo | |
Defined in Cardano.Slotting.Block | |
Eq BlockNo | |
Ord BlockNo | |
NoThunks BlockNo | |
Serialise BlockNo | |
type Rep BlockNo | |
Defined in Cardano.Slotting.Block type Rep BlockNo = D1 ('MetaData "BlockNo" "Cardano.Slotting.Block" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "BlockNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |