cardano-ledger-core-1.12.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.EpochBoundary

Description

This modules implements the necessary functions for the changes that can happen at epoch boundaries.

Synopsis

Documentation

newtype Stake c Source #

Type of stake as map from hash key to coins associated.

Constructors

Stake 

Instances

Instances details
Crypto c ⇒ ToJSON (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Generic (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Rep (Stake c) ∷ TypeType Source #

Methods

fromStake c → Rep (Stake c) x Source #

toRep (Stake c) x → Stake c Source #

Show (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

showsPrecIntStake c → ShowS Source #

showStake c → String Source #

showList ∷ [Stake c] → ShowS Source #

Crypto c ⇒ DecShareCBOR (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Share (Stake c) Source #

Crypto c ⇒ EncCBOR (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

encCBORStake c → Encoding Source #

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

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

NFData (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

rnfStake c → () Source #

Eq (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

(==)Stake c → Stake c → Bool Source #

(/=)Stake c → Stake c → Bool Source #

Typeable c ⇒ NoThunks (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (Stake c) = D1 ('MetaData "Stake" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.12.0.0-inplace" 'True) (C1 ('MetaCons "Stake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VP (Credential 'Staking c) (CompactForm Coin)))))
type Share (Stake c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

data SnapShot c Source #

Snapshot of the stake distribution.

Constructors

SnapShot 

Instances

Instances details
Crypto c ⇒ ToJSON (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Generic (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Rep (SnapShot c) ∷ TypeType Source #

Methods

fromSnapShot c → Rep (SnapShot c) x Source #

toRep (SnapShot c) x → SnapShot c Source #

Show (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Crypto c ⇒ DecShareCBOR (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Share (SnapShot c) Source #

Crypto c ⇒ EncCBOR (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

encCBORSnapShot c → Encoding Source #

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

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

NFData (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

rnfSnapShot c → () Source #

Eq (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

(==)SnapShot c → SnapShot c → Bool Source #

(/=)SnapShot c → SnapShot c → Bool Source #

Typeable c ⇒ NoThunks (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (SnapShot c) = D1 ('MetaData "SnapShot" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.12.0.0-inplace" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Stake c)) :*: (S1 ('MetaSel ('Just "ssDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c))) :*: S1 ('MetaSel ('Just "ssPoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool c) (PoolParams c))))))
type Share (SnapShot c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

data SnapShots c Source #

Snapshots of the stake distribution.

Note that ssStakeMark and ssStakeMarkPoolDistr are lazy on purpose since we only want to force the thunk after one stability window when we know that they are stable (so that we do not compute them if we do not have to). See more info in the Optimize TICKF ADR

Constructors

SnapShots 

Instances

Instances details
Crypto c ⇒ ToJSON (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Generic (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Rep (SnapShots c) ∷ TypeType Source #

Methods

fromSnapShots c → Rep (SnapShots c) x Source #

toRep (SnapShots c) x → SnapShots c Source #

Show (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Crypto c ⇒ DecCBOR (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Crypto c ⇒ DecShareCBOR (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Associated Types

type Share (SnapShots c) Source #

Crypto c ⇒ EncCBOR (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

encCBORSnapShots c → Encoding Source #

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

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

Default (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

defSnapShots c Source #

NFData (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

rnfSnapShots c → () Source #

Eq (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

Methods

(==)SnapShots c → SnapShots c → Bool Source #

(/=)SnapShots c → SnapShots c → Bool Source #

Typeable c ⇒ NoThunks (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Rep (SnapShots c) = D1 ('MetaData "SnapShots" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.12.0.0-inplace" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeMark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SnapShot c)) :*: S1 ('MetaSel ('Just "ssStakeMarkPoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PoolDistr c))) :*: (S1 ('MetaSel ('Just "ssStakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShot c)) :*: (S1 ('MetaSel ('Just "ssStakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShot c)) :*: S1 ('MetaSel ('Just "ssFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))))
type Share (SnapShots c) Source # 
Instance details

Defined in Cardano.Ledger.EpochBoundary

type Share (SnapShots c) = Share (SnapShot c)

poolStakeKeyHash 'StakePool c → VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Stake c Source #

Get stake of one pool

maxPoolEraPParams era ⇒ PParams era → CoinRationalRationalCoin Source #

Version of maxPool` that extracts ppA0L and ppNOptL from a PParams

maxPool'NonNegativeIntervalNaturalCoinRationalRationalCoin Source #

Calculate maximal pool reward

calculatePoolStake ∷ (KeyHash 'StakePool c → Bool) → VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Map (KeyHash 'StakePool c) Word64 Source #

Sum up the Coin (as CompactForm Coin = Word64) for each StakePool