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 era Source #

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

Constructors

Stake 

Fields

Instances

Instances details
Eq (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==)Stake era → Stake era → Bool #

(/=)Stake era → Stake era → Bool #

Ord (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

compareStake era → Stake era → Ordering #

(<)Stake era → Stake era → Bool #

(<=)Stake era → Stake era → Bool #

(>)Stake era → Stake era → Bool #

(>=)Stake era → Stake era → Bool #

maxStake era → Stake era → Stake era #

minStake era → Stake era → Stake era #

Show (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrecIntStake era → ShowS #

showStake era → String #

showList ∷ [Stake era] → ShowS #

NFData (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnfStake era → () #

(Era era, AnnotatedData (Script era)) ⇒ ToCBOR (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBORStake era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Stake era) → Size Source #

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

(Era era, AnnotatedData (Script era)) ⇒ FromCBOR (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBORDecoder s (Stake era) Source #

labelProxy (Stake era) → Text Source #

NoThunks (Stake era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

noThunks ∷ Context → Stake era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → Stake era → IO (Maybe ThunkInfo)

showTypeOfProxy (Stake era) → String

newtype BlocksMade era Source #

Blocks made

Constructors

BlocksMade 

Instances

Instances details
Eq (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==)BlocksMade era → BlocksMade era → Bool #

(/=)BlocksMade era → BlocksMade era → Bool #

Show (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrecIntBlocksMade era → ShowS #

showBlocksMade era → String #

showList ∷ [BlocksMade era] → ShowS #

Generic (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (BlocksMade era) ∷ TypeType #

Methods

fromBlocksMade era → Rep (BlocksMade era) x #

toRep (BlocksMade era) x → BlocksMade era #

NFData (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnfBlocksMade era → () #

Era era ⇒ ToCBOR (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBORBlocksMade era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (BlocksMade era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [BlocksMade era] → Size Source #

Era era ⇒ FromCBOR (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBORDecoder s (BlocksMade era) Source #

labelProxy (BlocksMade era) → Text Source #

NoThunks (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

noThunks ∷ Context → BlocksMade era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → BlocksMade era → IO (Maybe ThunkInfo)

showTypeOfProxy (BlocksMade era) → String

type Rep (BlocksMade era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

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

data SnapShot era Source #

Snapshot of the stake distribution.

Constructors

SnapShot 

Fields

Instances

Instances details
Eq (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==)SnapShot era → SnapShot era → Bool #

(/=)SnapShot era → SnapShot era → Bool #

Show (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrecIntSnapShot era → ShowS #

showSnapShot era → String #

showList ∷ [SnapShot era] → ShowS #

Generic (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (SnapShot era) ∷ TypeType #

Methods

fromSnapShot era → Rep (SnapShot era) x #

toRep (SnapShot era) x → SnapShot era #

NFData (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnfSnapShot era → () #

(Era era, AnnotatedData (Script era)) ⇒ ToCBOR (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBORSnapShot era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SnapShot era) → Size Source #

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

(Era era, AnnotatedData (Script era)) ⇒ FromCBOR (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBORDecoder s (SnapShot era) Source #

labelProxy (SnapShot era) → Text Source #

NoThunks (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

noThunks ∷ Context → SnapShot era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → SnapShot era → IO (Maybe ThunkInfo)

showTypeOfProxy (SnapShot era) → String

type Rep (SnapShot era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

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

data SnapShots era Source #

Snapshots of the stake distribution.

Constructors

SnapShots 

Fields

Instances

Instances details
Eq (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

(==)SnapShots era → SnapShots era → Bool #

(/=)SnapShots era → SnapShots era → Bool #

Show (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

showsPrecIntSnapShots era → ShowS #

showSnapShots era → String #

showList ∷ [SnapShots era] → ShowS #

Generic (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Associated Types

type Rep (SnapShots era) ∷ TypeType #

Methods

fromSnapShots era → Rep (SnapShots era) x #

toRep (SnapShots era) x → SnapShots era #

NFData (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

rnfSnapShots era → () #

(Era era, AnnotatedData (Script era)) ⇒ ToCBOR (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

toCBORSnapShots era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SnapShots era) → Size Source #

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

(Era era, AnnotatedData (Script era)) ⇒ FromCBOR (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

fromCBORDecoder s (SnapShots era) Source #

labelProxy (SnapShots era) → Text Source #

NoThunks (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

Methods

noThunks ∷ Context → SnapShots era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → SnapShots era → IO (Maybe ThunkInfo)

showTypeOfProxy (SnapShots era) → String

type Rep (SnapShots era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.EpochBoundary

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

aggregateUtxoCoinByCredential ∷ ∀ era. ShelleyBased era ⇒ Map Ptr (Credential 'Staking era) → UTxO era → Map (Credential 'Staking era) CoinMap (Credential 'Staking era) Coin Source #

Sum up all the Coin for each staking Credential

poolStakeKeyHash 'StakePool (Crypto era) → Map (Credential 'Staking era) (KeyHash 'StakePool (Crypto era)) → Stake era → Stake era Source #

Get stake of one pool

obligationPParams era → Map (Credential 'Staking era) CoinMap (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Coin Source #

Calculate total possible refunds.

maxPoolPParams era → CoinRationalRationalCoin Source #

Calculate maximal pool reward