Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This modules implements the necessary functions for the changes that can happen at epoch boundaries.
Synopsis
- newtype Stake = Stake {
- unStake ∷ VMap VB VP (Credential 'Staking) (CompactForm Coin)
- sumAllStake ∷ Stake → Coin
- sumAllStakeCompact ∷ Stake → CompactForm Coin
- sumStakePerPool ∷ VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Coin
- data SnapShot = SnapShot {
- ssStake ∷ !Stake
- ssDelegations ∷ !(VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))
- ssPoolParams ∷ !(VMap VB VB (KeyHash 'StakePool) PoolParams)
- data SnapShots = SnapShots {}
- emptySnapShot ∷ SnapShot
- emptySnapShots ∷ SnapShots
- poolStake ∷ KeyHash 'StakePool → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Stake
- maxPool ∷ EraPParams era ⇒ PParams era → Coin → Rational → Rational → Coin
- maxPool' ∷ NonNegativeInterval → Word16 → Coin → Rational → Rational → Coin
- calculatePoolDistr ∷ SnapShot → PoolDistr
- calculatePoolDistr' ∷ (KeyHash 'StakePool → Bool) → SnapShot → PoolDistr
- calculatePoolStake ∷ (KeyHash 'StakePool → Bool) → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Word64
- ssStakeMarkL ∷ Lens' SnapShots SnapShot
- ssStakeMarkPoolDistrL ∷ Lens' SnapShots PoolDistr
- ssStakeSetL ∷ Lens' SnapShots SnapShot
- ssStakeGoL ∷ Lens' SnapShots SnapShot
- ssFeeL ∷ Lens' SnapShots Coin
- ssStakeL ∷ Lens' SnapShot Stake
- ssStakeDistrL ∷ Lens' SnapShot (VMap VB VP (Credential 'Staking) (CompactForm Coin))
- ssDelegationsL ∷ Lens' SnapShot (VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))
- ssPoolParamsL ∷ Lens' SnapShot (VMap VB VB (KeyHash 'StakePool) PoolParams)
Documentation
Type of stake as map from hash key to coins associated.
Stake | |
|
Instances
ToJSON Stake Source # | |
Generic Stake Source # | |
Show Stake Source # | |
DecShareCBOR Stake Source # | |
EncCBOR Stake Source # | |
NFData Stake Source # | |
Defined in Cardano.Ledger.EpochBoundary | |
Eq Stake Source # | |
NoThunks Stake Source # | |
type Rep Stake Source # | |
Defined in Cardano.Ledger.EpochBoundary type Rep Stake = D1 ('MetaData "Stake" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "Stake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VP (Credential 'Staking) (CompactForm Coin))))) | |
type Share Stake Source # | |
sumAllStake ∷ Stake → Coin Source #
sumStakePerPool ∷ VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Coin Source #
Snapshot of the stake distribution.
SnapShot | |
|
Instances
ToJSON SnapShot Source # | |
Generic SnapShot Source # | |
Show SnapShot Source # | |
DecShareCBOR SnapShot Source # | |
EncCBOR SnapShot Source # | |
NFData SnapShot Source # | |
Defined in Cardano.Ledger.EpochBoundary | |
Eq SnapShot Source # | |
NoThunks SnapShot Source # | |
type Rep SnapShot Source # | |
Defined in Cardano.Ledger.EpochBoundary type Rep SnapShot = D1 ('MetaData "SnapShot" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Stake) :*: (S1 ('MetaSel ('Just "ssDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))) :*: S1 ('MetaSel ('Just "ssPoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) PoolParams))))) | |
type Share SnapShot 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
Instances
poolStake ∷ KeyHash 'StakePool → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Stake Source #
Get stake of one pool
maxPool' ∷ NonNegativeInterval → Word16 → Coin → Rational → Rational → Coin Source #
Calculate maximal pool reward
calculatePoolStake ∷ (KeyHash 'StakePool → Bool) → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Word64 Source #
Sum up the Coin (as CompactForm Coin = Word64) for each StakePool
ssStakeDistrL ∷ Lens' SnapShot (VMap VB VP (Credential 'Staking) (CompactForm Coin)) Source #