Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This modules implements the necessary functions for the changes that can happen at epoch boundaries.
Synopsis
- newtype Stake c = Stake {
- unStake ∷ VMap VB VP (Credential 'Staking c) (CompactForm Coin)
- sumAllStake ∷ Stake c → Coin
- sumAllStakeCompact ∷ Stake c → CompactForm Coin
- sumStakePerPool ∷ VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Map (KeyHash 'StakePool c) Coin
- data SnapShot c = SnapShot {
- ssStake ∷ !(Stake c)
- ssDelegations ∷ !(VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c))
- ssPoolParams ∷ !(VMap VB VB (KeyHash 'StakePool c) (PoolParams c))
- data SnapShots c = SnapShots {
- ssStakeMark ∷ SnapShot c
- ssStakeMarkPoolDistr ∷ PoolDistr c
- ssStakeSet ∷ !(SnapShot c)
- ssStakeGo ∷ !(SnapShot c)
- ssFee ∷ !Coin
- emptySnapShot ∷ SnapShot c
- emptySnapShots ∷ SnapShots c
- poolStake ∷ KeyHash 'StakePool c → VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Stake c
- maxPool ∷ EraPParams era ⇒ PParams era → Coin → Rational → Rational → Coin
- maxPool' ∷ NonNegativeInterval → Natural → Coin → Rational → Rational → Coin
- calculatePoolDistr ∷ SnapShot c → PoolDistr c
- calculatePoolDistr' ∷ ∀ c. (KeyHash 'StakePool c → Bool) → SnapShot c → PoolDistr c
- calculatePoolStake ∷ (KeyHash 'StakePool c → Bool) → VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Map (KeyHash 'StakePool c) Word64
- ssStakeMarkL ∷ Lens' (SnapShots c) (SnapShot c)
- ssStakeMarkPoolDistrL ∷ Lens' (SnapShots c) (PoolDistr c)
- ssStakeSetL ∷ Lens' (SnapShots c) (SnapShot c)
- ssStakeGoL ∷ Lens' (SnapShots c) (SnapShot c)
- ssFeeL ∷ Lens' (SnapShots c) Coin
- ssStakeL ∷ Lens' (SnapShot c) (Stake c)
- ssStakeDistrL ∷ Lens' (SnapShot c) (VMap VB VP (Credential 'Staking c) (CompactForm Coin))
- ssDelegationsL ∷ Lens' (SnapShot c) (VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c))
- ssPoolParamsL ∷ Lens' (SnapShot c) (VMap VB VB (KeyHash 'StakePool c) (PoolParams c))
Documentation
Type of stake as map from hash key to coins associated.
Stake | |
|
Instances
Crypto c ⇒ ToJSON (Stake c) Source # | |
Generic (Stake c) Source # | |
Show (Stake c) Source # | |
Crypto c ⇒ DecShareCBOR (Stake c) Source # | |
Crypto c ⇒ EncCBOR (Stake c) Source # | |
NFData (Stake c) Source # | |
Defined in Cardano.Ledger.EpochBoundary | |
Eq (Stake c) Source # | |
Typeable c ⇒ NoThunks (Stake c) Source # | |
type Rep (Stake c) Source # | |
Defined in Cardano.Ledger.EpochBoundary type Rep (Stake c) = D1 ('MetaData "Stake" "Cardano.Ledger.EpochBoundary" "cardano-ledger-core-1.16.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 # | |
sumAllStake ∷ Stake c → Coin Source #
sumStakePerPool ∷ VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Map (KeyHash 'StakePool c) Coin Source #
Snapshot of the stake distribution.
SnapShot | |
|
Instances
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
SnapShots | |
|
Instances
emptySnapShot ∷ SnapShot c Source #
poolStake ∷ KeyHash 'StakePool c → VMap VB VB (Credential 'Staking c) (KeyHash 'StakePool c) → Stake c → Stake c Source #
Get stake of one pool
maxPool' ∷ NonNegativeInterval → Natural → Coin → Rational → Rational → Coin Source #
Calculate maximal pool reward
calculatePoolDistr ∷ SnapShot c → PoolDistr c Source #
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
ssStakeDistrL ∷ Lens' (SnapShot c) (VMap VB VP (Credential 'Staking c) (CompactForm Coin)) Source #