cardano-ledger-byron-1.0.2.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

Constructors

SlotNumber 

Fields

Instances

Instances details
ToJSON SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Generic SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Associated Types

type Rep SlotNumberTypeType Source #

Num SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Show SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

FromCBOR SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

ToCBOR SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Methods

toCBORSlotNumberEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotNumberSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotNumber] → Size Source #

DecCBOR SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

EncCBOR SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Methods

encCBORSlotNumberEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy SlotNumberSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [SlotNumber] → Size Source #

NFData SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Methods

rnfSlotNumber → () Source #

Buildable SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Eq SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Ord SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

NoThunks 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

Monad m ⇒ ToJSON m SlotNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotNumber

Methods

toJSONSlotNumber → m JSValue Source #

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-1.0.2.0-inplace" 'True) (C1 ('MetaCons "SlotNumber" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

subSlotCountSlotCountSlotNumberSlotNumber 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

Constructors

SlotCount 

Fields

Instances

Instances details
Generic SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Associated Types

type Rep SlotCountTypeType Source #

Read SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Show SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

FromCBOR SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

ToCBOR SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Methods

toCBORSlotCountEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotCountSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotCount] → Size Source #

DecCBOR SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

EncCBOR SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Methods

encCBORSlotCountEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy SlotCountSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [SlotCount] → Size Source #

NFData SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Methods

rnfSlotCount → () Source #

Buildable SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Methods

buildSlotCountBuilder Source #

Eq SlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.SlotCount

Ord 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-1.0.2.0-inplace" 'True) (C1 ('MetaCons "SlotCount" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype EpochSlots Source #

The number of slots per epoch.

Constructors

EpochSlots 

Fields

Instances

Instances details
Data EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → EpochSlots → c EpochSlots Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c EpochSlots Source #

toConstrEpochSlotsConstr Source #

dataTypeOfEpochSlotsDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c EpochSlots) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c EpochSlots) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → EpochSlotsEpochSlots Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → EpochSlots → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → EpochSlots → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → EpochSlots → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochSlots → m EpochSlots Source #

Generic EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Associated Types

type Rep EpochSlotsTypeType Source #

Read EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Show EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

FromCBOR EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

ToCBOR EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

toCBOREpochSlotsEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochSlotsSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochSlots] → Size Source #

DecCBOR EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

EncCBOR EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Methods

encCBOREpochSlotsEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy EpochSlotsSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [EpochSlots] → Size Source #

Buildable EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Eq EpochSlots Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochSlots

Ord 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-1.0.2.0-inplace" 'True) (C1 ('MetaCons "EpochSlots" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSlots") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data WithEpochSlots a Source #

Data with an accompanying slots per epoch context.

Constructors

WithEpochSlots 

epochFirstSlotEpochSlotsEpochNumberSlotNumber 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.

Constructors

EpochNumber 

Instances

Instances details
ToJSON EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Data EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → EpochNumber → c EpochNumber Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c EpochNumber Source #

toConstrEpochNumberConstr Source #

dataTypeOfEpochNumberDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c EpochNumber) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c EpochNumber) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → EpochNumberEpochNumber Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → EpochNumber → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → EpochNumber → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → EpochNumber → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → EpochNumber → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → EpochNumber → m EpochNumber Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochNumber → m EpochNumber Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → EpochNumber → m EpochNumber Source #

Bounded EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Enum EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Generic EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Associated Types

type Rep EpochNumberTypeType Source #

Ix EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Num EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Integral 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

FromCBOR EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

ToCBOR EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

toCBOREpochNumberEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochNumberSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochNumber] → Size Source #

DecCBOR EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

EncCBOR EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

encCBOREpochNumberEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy EpochNumberSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [EpochNumber] → Size Source #

NFData EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

rnfEpochNumber → () Source #

Buildable EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Eq EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Ord EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

NoThunks 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

Monad m ⇒ ToJSON m EpochNumber Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochNumber

Methods

toJSONEpochNumber → m JSValue Source #

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-1.0.2.0-inplace" '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

Constructors

EpochAndSlotCount 

Instances

Instances details
Generic EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Associated Types

type Rep EpochAndSlotCountTypeType Source #

Show EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

FromCBOR EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

ToCBOR EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

DecCBOR EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

EncCBOR EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

NFData EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Methods

rnfEpochAndSlotCount → () Source #

Buildable EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Eq EpochAndSlotCount Source # 
Instance details

Defined in Cardano.Chain.Slotting.EpochAndSlotCount

Ord 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-1.0.2.0-inplace" 'False) (C1 ('MetaCons "EpochAndSlotCount" 'PrefixI 'True) (S1 ('MetaSel ('Just "epochNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: S1 ('MetaSel ('Just "slotCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotCount)))