cardano-ledger-byron-0.1.0.0: The blockchain layer of Cardano during the Byron era
Safe Haskell None
Language Haskell2010

Cardano.Chain.Slotting

Synopsis

Documentation

newtype SlotNumber Source #

SlotNumber is an absolute slot number from the beginning of time

SlotNumber is held in a Word64 . Assuming a slot every 20 seconds, Word64 is sufficient for slot indices for 10^13 years.

Instances

Instances details
Eq SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Num SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Ord SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Show SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Generic SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

NFData SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

ToJSON SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

ToCBOR SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

FromCBOR SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Buildable SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

NoThunks SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Monad m => ToJSON m SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

MonadError SchemaError m => FromJSON m SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

type Rep SlotNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

type Rep SlotNumber = D1 (' MetaData "SlotNumber" "Cardano.Chain.Slotting.SlotNumber" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' True ) ( C1 (' MetaCons "SlotNumber" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unSlotNumber") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word64 )))

subSlotCount :: SlotCount -> SlotNumber -> SlotNumber Source #

Deprecated: this function is dangerous and can usually be replaced by addSlotCount

Decrease a SlotNumber by SlotCount , going no lower than 0

newtype SlotCount Source #

A number of slots

Instances

Instances details
Eq SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Ord SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Read SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Show SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Generic SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

NFData SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

ToCBOR SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

FromCBOR SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Buildable SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

type Rep SlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

type Rep SlotCount = D1 (' MetaData "SlotCount" "Cardano.Chain.Slotting.SlotCount" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' True ) ( C1 (' MetaCons "SlotCount" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unSlotCount") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word64 )))

newtype EpochSlots Source #

The number of slots per epoch.

Instances

Instances details
Eq EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Data EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> EpochSlots -> c EpochSlots Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c EpochSlots Source #

toConstr :: EpochSlots -> Constr Source #

dataTypeOf :: EpochSlots -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c EpochSlots ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c EpochSlots ) Source #

gmapT :: ( forall b. Data b => b -> b) -> EpochSlots -> EpochSlots Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> EpochSlots -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> EpochSlots -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> EpochSlots -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> EpochSlots -> m EpochSlots Source #

Ord EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Read EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Show EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Generic EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

ToCBOR EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

FromCBOR EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Buildable EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

NoThunks EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

type Rep EpochSlots = D1 (' MetaData "EpochSlots" "Cardano.Chain.Slotting.EpochSlots" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' True ) ( C1 (' MetaCons "EpochSlots" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unEpochSlots") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word64 )))

epochFirstSlot :: EpochSlots -> EpochNumber -> SlotNumber Source #

Calculate the first slot in an epoch.

Note that this function will give an undetermined result if Byron is not the first and only era - a more robust method should use EpochInfo from cardano-slotting.

newtype EpochNumber Source #

Index of epoch.

Instances

Instances details
Bounded EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Enum EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Eq EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Integral EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Data EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> EpochNumber -> c EpochNumber Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c EpochNumber Source #

toConstr :: EpochNumber -> Constr Source #

dataTypeOf :: EpochNumber -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c EpochNumber ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c EpochNumber ) Source #

gmapT :: ( forall b. Data b => b -> b) -> EpochNumber -> EpochNumber Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> EpochNumber -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> EpochNumber -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> EpochNumber -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> EpochNumber -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> EpochNumber -> m EpochNumber Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> EpochNumber -> m EpochNumber Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> EpochNumber -> m EpochNumber Source #

Num EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Ord EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Real EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Show EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Ix EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Generic EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

NFData EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

ToJSON EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

ToCBOR EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

FromCBOR EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Buildable EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

NoThunks EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Monad m => ToJSON m EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

MonadError SchemaError m => FromJSON m EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

type Rep EpochNumber Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

type Rep EpochNumber = D1 (' MetaData "EpochNumber" "Cardano.Chain.Slotting.EpochNumber" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' True ) ( C1 (' MetaCons "EpochNumber" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getEpochNumber") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word64 )))

isBootstrapEra Source #

Arguments

:: EpochNumber

Unlock stake epoch

-> EpochNumber

Epoch in question (for which we determine whether it belongs to the bootstrap era)

-> Bool

Bootstrap era is ongoing until stakes are unlocked. The reward era starts from the epoch specified as the epoch that unlocks stakes:

                      [unlock stake epoch]
                              /
  Epoch: ...  E-3  E-2  E-1   E+0  E+1  E+2  E+3  ...
         ------------------ | -----------------------
              Bootstrap era   Reward era
  

data EpochAndSlotCount Source #

EpochAndSlotCount identifies a slot by its EpochNumber and the number of slots into the epoch that it sits

Instances

Instances details
Eq EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Ord EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Show EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Generic EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

NFData EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

ToCBOR EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

FromCBOR EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Buildable EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

type Rep EpochAndSlotCount Source #
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

type Rep EpochAndSlotCount = D1 (' MetaData "EpochAndSlotCount" "Cardano.Chain.Slotting.EpochAndSlotCount" "cardano-ledger-byron-0.1.0.0-1U5kXR8zMRrE7QjCz70XVD" ' False ) ( C1 (' MetaCons "EpochAndSlotCount" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "epochNo") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 EpochNumber ) :*: S1 (' MetaSel (' Just "slotCount") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 SlotCount )))