Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Ledger.Shelley.EpochBoundary
Description
This modules implements the necessary functions for the changes that can happen at epoch boundaries.
Synopsis
-
newtype
Stake
crypto =
Stake
{
- unStake :: VMap VB VP ( Credential ' Staking crypto) ( CompactForm Coin )
- sumAllStake :: Stake crypto -> Coin
- sumStakePerPool :: VMap VB VB ( Credential ' Staking crypto) ( KeyHash ' StakePool crypto) -> Stake crypto -> Map ( KeyHash ' StakePool crypto) Coin
-
data
SnapShot
crypto =
SnapShot
{
- _stake :: !( Stake crypto)
- _delegations :: !( VMap VB VB ( Credential ' Staking crypto) ( KeyHash ' StakePool crypto))
- _poolParams :: !( VMap VB VB ( KeyHash ' StakePool crypto) ( PoolParams crypto))
-
data
SnapShots
crypto =
SnapShots
{
- _pstakeMark :: SnapShot crypto
- _pstakeSet :: !( SnapShot crypto)
- _pstakeGo :: !( SnapShot crypto)
- _feeSS :: ! Coin
- emptySnapShot :: SnapShot crypto
- emptySnapShots :: SnapShots crypto
- poolStake :: KeyHash ' StakePool crypto -> VMap VB VB ( Credential ' Staking crypto) ( KeyHash ' StakePool crypto) -> Stake crypto -> Stake crypto
- obligation :: forall crypto pp anymap. ( HasField "_keyDeposit" pp Coin , HasField "_poolDeposit" pp Coin , Foldable (anymap ( Credential ' Staking crypto))) => pp -> anymap ( Credential ' Staking crypto) Coin -> Map ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Coin
- maxPool :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => pp -> Coin -> Rational -> Rational -> Coin
- maxPool' :: NonNegativeInterval -> Natural -> Coin -> Rational -> Rational -> Coin
Documentation
Type of stake as map from hash key to coins associated.
Constructors
Stake | |
Fields
|
Instances
Eq ( Stake crypto) Source # | |
Show ( Stake crypto) Source # | |
Generic ( Stake crypto) Source # | |
NFData ( Stake crypto) Source # | |
Defined in Cardano.Ledger.Shelley.EpochBoundary |
|
Crypto crypto => ToCBOR ( Stake crypto) Source # | |
Defined in Cardano.Ledger.Shelley.EpochBoundary |
|
Crypto crypto => FromSharedCBOR ( Stake crypto) Source # | |
Typeable crypto => NoThunks ( Stake crypto) Source # | |
type Rep ( Stake crypto) Source # | |
Defined in Cardano.Ledger.Shelley.EpochBoundary
type
Rep
(
Stake
crypto) =
D1
('
MetaData
"Stake" "Cardano.Ledger.Shelley.EpochBoundary" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" '
True
) (
C1
('
MetaCons
"Stake" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unStake") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
VMap
VB
VP
(
Credential
'
Staking
crypto) (
CompactForm
Coin
)))))
|
|
type Share ( Stake crypto) Source # | |
sumAllStake :: Stake crypto -> Coin Source #
sumStakePerPool :: VMap VB VB ( Credential ' Staking crypto) ( KeyHash ' StakePool crypto) -> Stake crypto -> Map ( KeyHash ' StakePool crypto) Coin Source #
Snapshot of the stake distribution.
Constructors
SnapShot | |
Fields
|
Instances
data SnapShots crypto Source #
Snapshots of the stake distribution.
Constructors
SnapShots | |
Fields
|
Instances
emptySnapShot :: SnapShot crypto Source #
emptySnapShots :: SnapShots crypto Source #
poolStake :: KeyHash ' StakePool crypto -> VMap VB VB ( Credential ' Staking crypto) ( KeyHash ' StakePool crypto) -> Stake crypto -> Stake crypto Source #
Get stake of one pool
obligation :: forall crypto pp anymap. ( HasField "_keyDeposit" pp Coin , HasField "_poolDeposit" pp Coin , Foldable (anymap ( Credential ' Staking crypto))) => pp -> anymap ( Credential ' Staking crypto) Coin -> Map ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Coin Source #
Calculate total possible refunds.