shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.EpochBoundary

Description

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

Synopsis

Documentation

newtype Stake crypto Source #

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

Constructors

Stake 

Fields

Instances

Instances details
Eq (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==) :: Stake crypto -> Stake crypto -> Bool #

(/=) :: Stake crypto -> Stake crypto -> Bool #

Ord (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

compare :: Stake crypto -> Stake crypto -> Ordering #

(<) :: Stake crypto -> Stake crypto -> Bool #

(<=) :: Stake crypto -> Stake crypto -> Bool #

(>) :: Stake crypto -> Stake crypto -> Bool #

(>=) :: Stake crypto -> Stake crypto -> Bool #

max :: Stake crypto -> Stake crypto -> Stake crypto #

min :: Stake crypto -> Stake crypto -> Stake crypto #

Show (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrec :: Int -> Stake crypto -> ShowS #

show :: Stake crypto -> String #

showList :: [Stake crypto] -> ShowS #

NFData (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnf :: Stake crypto -> () #

Crypto crypto => ToCBOR (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBOR :: Stake crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Stake crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Stake crypto] -> Size Source #

Crypto crypto => FromCBOR (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBOR :: Decoder s (Stake crypto) Source #

label :: Proxy (Stake crypto) -> Text Source #

NoThunks (Stake crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

newtype BlocksMade crypto Source #

Blocks made

Constructors

BlocksMade 

Instances

Instances details
Eq (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==) :: BlocksMade crypto -> BlocksMade crypto -> Bool #

(/=) :: BlocksMade crypto -> BlocksMade crypto -> Bool #

Show (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrec :: Int -> BlocksMade crypto -> ShowS #

show :: BlocksMade crypto -> String #

showList :: [BlocksMade crypto] -> ShowS #

Generic (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (BlocksMade crypto) :: Type -> Type #

Methods

from :: BlocksMade crypto -> Rep (BlocksMade crypto) x #

to :: Rep (BlocksMade crypto) x -> BlocksMade crypto #

NFData (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnf :: BlocksMade crypto -> () #

Crypto crypto => ToCBOR (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBOR :: BlocksMade crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (BlocksMade crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [BlocksMade crypto] -> Size Source #

Crypto crypto => FromCBOR (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBOR :: Decoder s (BlocksMade crypto) Source #

label :: Proxy (BlocksMade crypto) -> Text Source #

NoThunks (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (BlocksMade crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (BlocksMade crypto) = D1 ('MetaData "BlocksMade" "Shelley.Spec.Ledger.EpochBoundary" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'True) (C1 ('MetaCons "BlocksMade" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlocksMade") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'StakePool crypto) Natural))))

data SnapShot crypto Source #

Snapshot of the stake distribution.

Constructors

SnapShot 

Fields

Instances

Instances details
Eq (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==) :: SnapShot crypto -> SnapShot crypto -> Bool #

(/=) :: SnapShot crypto -> SnapShot crypto -> Bool #

Show (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrec :: Int -> SnapShot crypto -> ShowS #

show :: SnapShot crypto -> String #

showList :: [SnapShot crypto] -> ShowS #

Generic (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (SnapShot crypto) :: Type -> Type #

Methods

from :: SnapShot crypto -> Rep (SnapShot crypto) x #

to :: Rep (SnapShot crypto) x -> SnapShot crypto #

NFData (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnf :: SnapShot crypto -> () #

Crypto crypto => ToCBOR (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBOR :: SnapShot crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (SnapShot crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [SnapShot crypto] -> Size Source #

Crypto crypto => FromCBOR (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBOR :: Decoder s (SnapShot crypto) Source #

label :: Proxy (SnapShot crypto) -> Text Source #

NoThunks (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (SnapShot crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (SnapShot crypto) = D1 ('MetaData "SnapShot" "Shelley.Spec.Ledger.EpochBoundary" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "_stake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Stake crypto)) :*: (S1 ('MetaSel ('Just "_delegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking crypto) (KeyHash 'StakePool crypto))) :*: S1 ('MetaSel ('Just "_poolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool crypto) (PoolParams crypto))))))

data SnapShots crypto Source #

Snapshots of the stake distribution.

Constructors

SnapShots 

Fields

Instances

Instances details
Eq (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==) :: SnapShots crypto -> SnapShots crypto -> Bool #

(/=) :: SnapShots crypto -> SnapShots crypto -> Bool #

Show (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrec :: Int -> SnapShots crypto -> ShowS #

show :: SnapShots crypto -> String #

showList :: [SnapShots crypto] -> ShowS #

Generic (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (SnapShots crypto) :: Type -> Type #

Methods

from :: SnapShots crypto -> Rep (SnapShots crypto) x #

to :: Rep (SnapShots crypto) x -> SnapShots crypto #

NFData (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnf :: SnapShots crypto -> () #

Crypto crypto => ToCBOR (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBOR :: SnapShots crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (SnapShots crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [SnapShots crypto] -> Size Source #

Crypto crypto => FromCBOR (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBOR :: Decoder s (SnapShots crypto) Source #

label :: Proxy (SnapShots crypto) -> Text Source #

NoThunks (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (SnapShots crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

type Rep (SnapShots crypto) = D1 ('MetaData "SnapShots" "Shelley.Spec.Ledger.EpochBoundary" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_pstakeMark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShot crypto)) :*: S1 ('MetaSel ('Just "_pstakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShot crypto))) :*: (S1 ('MetaSel ('Just "_pstakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShot crypto)) :*: S1 ('MetaSel ('Just "_feeSS") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))

aggregateUtxoCoinByCredential :: forall era. ShelleyBased era => Map Ptr (Credential 'Staking (Crypto era)) -> UTxO era -> Map (Credential 'Staking (Crypto era)) Coin -> Map (Credential 'Staking (Crypto era)) Coin Source #

Sum up all the Coin for each staking Credential

poolStake :: KeyHash 'StakePool crypto -> Map (Credential 'Staking crypto) (KeyHash 'StakePool crypto) -> Stake crypto -> Stake crypto Source #

Get stake of one pool

obligation :: PParams era -> Map (Credential 'Staking (Crypto era)) Coin -> Map (KeyHash 'StakePool (Crypto era)) (PoolParams (Crypto era)) -> Coin Source #

Calculate total possible refunds.

maxPool :: PParams era -> Coin -> Rational -> Rational -> Coin Source #

Calculate maximal pool reward