cardano-ledger-core-1.17.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.State

Synopsis

Documentation

data AccountState Source #

Constructors

AccountState 

Fields

Instances

Instances details
ToJSON AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

Generic AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

Associated Types

type Rep AccountStateTypeType #

Show AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

DecCBOR AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

EncCBOR AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

Default AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

NFData AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

Methods

rnfAccountState → () #

Eq AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

NoThunks AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

type Rep AccountState Source # 
Instance details

Defined in Cardano.Ledger.State.AccountState

type Rep AccountState = D1 ('MetaData "AccountState" "Cardano.Ledger.State.AccountState" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "AccountState" 'PrefixI 'True) (S1 ('MetaSel ('Just "asTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "asReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

class CanGetUTxO t where Source #

Minimal complete definition

Nothing

Methods

utxoGSimpleGetter (t era) (UTxO era) Source #

default utxoGCanSetUTxO t ⇒ SimpleGetter (t era) (UTxO era) Source #

Instances

Instances details
CanGetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoGSimpleGetter (UTxO era) (UTxO era) Source #

class CanGetUTxO t ⇒ CanSetUTxO t where Source #

Methods

utxoLLens' (t era) (UTxO era) Source #

Instances

Instances details
CanSetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoLLens' (UTxO era) (UTxO era) Source #

Primitives

newtype UTxO era Source #

The unspent transaction outputs.

Constructors

UTxO 

Fields

Instances

Instances details
CanGetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoGSimpleGetter (UTxO era) (UTxO era) Source #

CanSetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoLLens' (UTxO era) (UTxO era) Source #

ToJSON (TxOut era) ⇒ ToJSON (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

toJSONUTxO era → Value Source #

toEncodingUTxO era → Encoding Source #

toJSONList ∷ [UTxO era] → Value Source #

toEncodingList ∷ [UTxO era] → Encoding Source #

omitFieldUTxO era → Bool Source #

Era era ⇒ Monoid (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

memptyUTxO era #

mappendUTxO era → UTxO era → UTxO era #

mconcat ∷ [UTxO era] → UTxO era #

Semigroup (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

(<>)UTxO era → UTxO era → UTxO era #

sconcatNonEmpty (UTxO era) → UTxO era #

stimesIntegral b ⇒ b → UTxO era → UTxO era #

Generic (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Associated Types

type Rep (UTxO era) ∷ TypeType #

Methods

fromUTxO era → Rep (UTxO era) x #

toRep (UTxO era) x → UTxO era #

Show (TxOut era) ⇒ Show (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

showsPrecIntUTxO era → ShowS #

showUTxO era → String #

showList ∷ [UTxO era] → ShowS #

(DecCBOR (TxOut era), Era era) ⇒ FromCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

fromCBORDecoder s (UTxO era) Source #

labelProxy (UTxO era) → Text Source #

(EncCBOR (TxOut era), Era era) ⇒ ToCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

toCBORUTxO era → Encoding Source #

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

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

(Era era, DecCBOR (TxOut era)) ⇒ DecCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

decCBORDecoder s (UTxO era) Source #

dropCBORProxy (UTxO era) → Decoder s () Source #

labelProxy (UTxO era) → Text Source #

(DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking)) ⇒ DecShareCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Associated Types

type Share (UTxO era) Source #

Methods

getShareUTxO era → Share (UTxO era) Source #

decShareCBORShare (UTxO era) → Decoder s (UTxO era) Source #

decSharePlusCBORStateT (Share (UTxO era)) (Decoder s) (UTxO era) Source #

(Era era, EncCBOR (TxOut era)) ⇒ EncCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

encCBORUTxO era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (UTxO era) → Size Source #

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

Default (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

defUTxO era Source #

(Era era, NFData (TxOut era)) ⇒ NFData (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

rnfUTxO era → () #

(Era era, Eq (TxOut era)) ⇒ Eq (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

(==)UTxO era → UTxO era → Bool #

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

NoThunks (TxOut era) ⇒ NoThunks (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

type Rep (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

type Rep (UTxO era) = D1 ('MetaData "UTxO" "Cardano.Ledger.State.UTxO" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "UTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "unUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TxIn (TxOut era)))))
type Share (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

class EraTx era ⇒ EraUTxO era where Source #

Associated Types

type ScriptsNeeded era = (r ∷ Type) | r → era Source #

A customizable type on per era basis for the information required to find all scripts needed for the transaction.

Methods

getConsumedValue Source #

Arguments

PParams era 
→ (Credential 'StakingMaybe Coin)

Function that can lookup current delegation deposits

→ (Credential 'DRepRoleMaybe Coin)

Function that can lookup current drep deposits

UTxO era 
TxBody era 
Value era 

Calculate all the value that is being consumed by the transaction.

getProducedValue Source #

Arguments

PParams era 
→ (KeyHash 'StakePoolBool)

Check whether a pool with a supplied PoolStakeId is already registered.

TxBody era 
Value era 

getScriptsProvided Source #

Arguments

UTxO era

For some era it is necessary to look into the UTxO to find all of the available scripts for the transaction

Tx era 
ScriptsProvided era 

Initial eras will look into witness set to find all of the available scripts, but starting with Babbage we can look for available scripts in the UTxO using reference inputs.

getScriptsNeededUTxO era → TxBody era → ScriptsNeeded era Source #

Produce all the information required for figuring out which scripts are required for the transaction to be valid, once those scripts are evaluated

getScriptsHashesNeededScriptsNeeded era → Set ScriptHash Source #

Extract the set of all script hashes that are needed for script validation.

getWitsVKeyNeededCertState era → UTxO era → TxBody era → Set (KeyHash 'Witness) Source #

Extract all of the KeyHash witnesses that are required for validating the transaction

getMinFeeTxUtxoPParams era → Tx era → UTxO era → Coin Source #

Minimum fee computation, excluding witnesses and including ref scripts size

newtype ScriptsProvided era Source #

The only reason it is a newtype instead of just a Map is becuase for later eras is expensive to compute the actual map, so we want to use the type safety guidance to avoid redundant work.

Constructors

ScriptsProvided 

Instances

Instances details
Generic (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Associated Types

type Rep (ScriptsProvided era) ∷ TypeType #

Methods

fromScriptsProvided era → Rep (ScriptsProvided era) x #

toRep (ScriptsProvided era) x → ScriptsProvided era #

(Era era, Show (Script era)) ⇒ Show (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

showsPrecIntScriptsProvided era → ShowS #

showScriptsProvided era → String #

showList ∷ [ScriptsProvided era] → ShowS #

(Era era, NFData (Script era)) ⇒ NFData (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

rnfScriptsProvided era → () #

(Era era, Eq (Script era)) ⇒ Eq (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

(==)ScriptsProvided era → ScriptsProvided era → Bool #

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

(Era era, Ord (Script era)) ⇒ Ord (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

type Rep (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

type Rep (ScriptsProvided era) = D1 ('MetaData "ScriptsProvided" "Cardano.Ledger.State.UTxO" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "ScriptsProvided" 'PrefixI 'True) (S1 ('MetaSel ('Just "unScriptsProvided") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ScriptHash (Script era)))))

Functions

txinsEraTxBody era ⇒ TxBody era → Set TxIn Source #

Compute the UTxO inputs of a transaction. txins has the same problems as txouts, see notes below.

txinLookupTxInUTxO era → Maybe (TxOut era) Source #

Lookup a txin for a given UTxO collection

txInsFilter Source #

Arguments

UTxO era

Source UTxO

Set TxIn

Which of the TxIns you would like to keep.

UTxO era 

Filter out TxIn's from the UTxO map

txouts ∷ ∀ era. EraTxBody era ⇒ TxBody era → UTxO era Source #

Compute the transaction outputs of a transaction.

balanceEraTxOut era ⇒ UTxO era → Value era Source #

Determine the total balance contained in the UTxO.

coinBalanceEraTxOut era ⇒ UTxO era → Coin Source #

Determine the total Ada only balance contained in the UTxO. This is equivalent to `coin . balance`, but it will be more efficient

sumAllValue ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Value era Source #

Sum all the value in any Foldable with TxOuts

sumAllCoin ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Coin Source #

Sum all the Coins in any Foldable with with TxOuts. Care should be taken since it is susceptible to integer overflow, therefore make sure this function is not applied to unvalidated TxOuts

areAllAdaOnly ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Bool Source #

Check whether any of the supplied TxOuts contain any MultiAssets. Returns True if non of them do.

verifyWitVKeyTypeable kr ⇒ Hash HASH EraIndependentTxBodyWitVKey kr → Bool Source #

Verify a transaction body witness

getScriptHashAddrMaybe ScriptHash Source #

Extract script hash from value address with script.

data IndividualPoolStake Source #

The IndividualPoolStake contains all the stake controlled by a single stake pool (the combination of owners and delegates) for a given epoch, and also the hash of the stake pool's registered VRF key.

When a stake pool produces a block, the header contains the full VRF verification key and VRF value for leader election. We check the VRF key against the value in IndividualPoolStake and we check the VRF value using the epoch nonce and the relative stake of the pool as given in IndividualPoolStake. The stake is relative to the total amount of active stake in the network. Stake is active if it is both registered and delegated to a registered stake pool.

Constructors

IndividualPoolStake 

Fields

Instances

Instances details
ToJSON IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Generic IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Associated Types

type Rep IndividualPoolStakeTypeType #

Show IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

DecCBOR IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

EncCBOR IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

NFData IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

rnfIndividualPoolStake → () #

Eq IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

NoThunks IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep IndividualPoolStake = D1 ('MetaData "IndividualPoolStake" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "IndividualPoolStake" 'PrefixI 'True) (S1 ('MetaSel ('Just "individualPoolStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational) :*: (S1 ('MetaSel ('Just "individualTotalPoolStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin)) :*: S1 ('MetaSel ('Just "individualPoolStakeVrf") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VRFVerKeyHash 'StakePoolVRF)))))

data PoolDistr Source #

A map of stake pool IDs (the hash of the stake pool operator's verification key) to IndividualPoolStake. Also holds absolute values necessary for the calculations in the computeDRepDistr.

Constructors

PoolDistr 

Fields

Instances

Instances details
ToJSON PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Generic PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Associated Types

type Rep PoolDistrTypeType #

Methods

fromPoolDistrRep PoolDistr x #

toRep PoolDistr x → PoolDistr #

Show PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

showsPrecIntPoolDistrShowS #

showPoolDistrString #

showList ∷ [PoolDistr] → ShowS #

DecCBOR PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

EncCBOR PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

encCBORPoolDistrEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy PoolDistrSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [PoolDistr] → Size Source #

NFData PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

rnfPoolDistr → () #

Eq PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

(==)PoolDistrPoolDistrBool #

(/=)PoolDistrPoolDistrBool #

NoThunks PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep PoolDistr = D1 ('MetaData "PoolDistr" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "PoolDistr" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPoolDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) IndividualPoolStake)) :*: S1 ('MetaSel ('Just "pdTotalActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin))))

newtype Stake Source #

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

Constructors

Stake 

Instances

Instances details
ToJSON Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Generic Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep StakeTypeType #

Methods

fromStakeRep Stake x #

toRep Stake x → Stake #

Show Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

showsPrecIntStakeShowS #

showStakeString #

showList ∷ [Stake] → ShowS #

DecShareCBOR Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share Stake Source #

EncCBOR Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

encCBORStakeEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy StakeSize Source #

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

NFData Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnfStake → () #

Eq Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

(==)StakeStakeBool #

(/=)StakeStakeBool #

NoThunks Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep Stake Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep Stake = D1 ('MetaData "Stake" "Cardano.Ledger.State.SnapShots" "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 # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

data SnapShot Source #

Snapshot of the stake distribution.

Instances

Instances details
ToJSON SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Generic SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep SnapShotTypeType #

Methods

fromSnapShotRep SnapShot x #

toRep SnapShot x → SnapShot #

Show SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

showsPrecIntSnapShotShowS #

showSnapShotString #

showList ∷ [SnapShot] → ShowS #

DecShareCBOR SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share SnapShot Source #

EncCBOR SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

encCBORSnapShotEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy SnapShotSize Source #

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

NFData SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnfSnapShot → () #

Eq SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

(==)SnapShotSnapShotBool #

(/=)SnapShotSnapShotBool #

NoThunks SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SnapShot = D1 ('MetaData "SnapShot" "Cardano.Ledger.State.SnapShots" "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 # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

data SnapShots 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

Instances details
ToJSON SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Generic SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep SnapShotsTypeType #

Methods

fromSnapShotsRep SnapShots x #

toRep SnapShots x → SnapShots #

Show SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

showsPrecIntSnapShotsShowS #

showSnapShotsString #

showList ∷ [SnapShots] → ShowS #

DecCBOR SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share SnapShots Source #

EncCBOR SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

encCBORSnapShotsEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy SnapShotsSize Source #

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

Default SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

defSnapShots Source #

NFData SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnfSnapShots → () #

Eq SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

(==)SnapShotsSnapShotsBool #

(/=)SnapShotsSnapShotsBool #

NoThunks SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SnapShots = D1 ('MetaData "SnapShots" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeMark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot) :*: S1 ('MetaSel ('Just "ssStakeMarkPoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PoolDistr)) :*: (S1 ('MetaSel ('Just "ssStakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "ssStakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: S1 ('MetaSel ('Just "ssFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))))
type Share SnapShots Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

poolStakeKeyHash 'StakePoolVMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → StakeStake Source #

Get stake of one pool

maxPoolEraPParams era ⇒ PParams era → CoinRationalRationalCoin Source #

Version of maxPool` that extracts ppA0L and ppNOptL from a PParams

maxPool'NonNegativeIntervalNonZero Word16CoinRationalRationalCoin Source #

Calculate maximal pool reward

calculatePoolStake ∷ (KeyHash 'StakePoolBool) → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → StakeMap (KeyHash 'StakePool) Word64 Source #

Sum up the Coin (as CompactForm Coin = Word64) for each StakePool

class (EraPParams era, Eq (GovState era), Show (GovState era), NoThunks (GovState era), NFData (GovState era), EncCBOR (GovState era), DecCBOR (GovState era), DecShareCBOR (GovState era), Share (GovState era) ~ (Interns (Credential 'Staking), Interns (KeyHash 'StakePool), Interns (Credential 'DRepRole), Interns (Credential 'HotCommitteeRole)), ToCBOR (GovState era), FromCBOR (GovState era), Default (GovState era), ToJSON (GovState era)) ⇒ EraGov era where Source #

Associated Types

type GovState era = (r ∷ Type) | r → era Source #

Methods

emptyGovStateGovState era Source #

Construct empty governance state

curPParamsGovStateLLens' (GovState era) (PParams era) Source #

Lens for accessing current protocol parameters

prevPParamsGovStateLLens' (GovState era) (PParams era) Source #

Lens for accessing the previous protocol parameters

futurePParamsGovStateLLens' (GovState era) (FuturePParams era) Source #

Lens for accessing the future protocol parameters.

This lens will produce DefinitePParamsUpdate whenever we are absolutely sure that the new PParams will be updated. Which means there will be no chance of a DefinitePParamsUpdate value until we are past the point of no return, which is 2 stability windows before the end of the epoch. This lens is mostly intended for ledger usage and nextEpochUpdatedPParams should be used instead whenever definite results are desired.

obligationGovStateGovState era → Obligations Source #

data FuturePParams era Source #

Constructors

NoPParamsUpdate

This indicates that there is definitely not going to be an update to PParams expected at the next epoch boundary.

DefinitePParamsUpdate !(PParams era)

This case specifies the PParams that will be adopted at the next epoch boundary.

PotentialPParamsUpdate (Maybe (PParams era))

With this case there is no guarantee that these will be the new PParams, users should not rely on this value to be computed efficiently and should use nextEpochPParams instead. The field is lazy on purpose, since we truly need to compute this field only towards the end of the epoch, which is done by solidifyFuturePParams two stability windows before the end of the epoch.

Instances

Instances details
ToJSON (PParams era) ⇒ ToJSON (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Generic (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Associated Types

type Rep (FuturePParams era) ∷ TypeType #

Methods

fromFuturePParams era → Rep (FuturePParams era) x #

toRep (FuturePParams era) x → FuturePParams era #

Show (PParams era) ⇒ Show (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

showsPrecIntFuturePParams era → ShowS #

showFuturePParams era → String #

showList ∷ [FuturePParams era] → ShowS #

(Typeable era, DecCBOR (PParams era)) ⇒ DecCBOR (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

(Typeable era, EncCBOR (PParams era)) ⇒ EncCBOR (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

encCBORFuturePParams era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (FuturePParams era) → Size Source #

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

Default (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

defFuturePParams era Source #

NFData (PParams era) ⇒ NFData (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

rnfFuturePParams era → () #

Eq (PParams era) ⇒ Eq (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

(==)FuturePParams era → FuturePParams era → Bool #

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

NoThunks (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

type Rep (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

type Rep (FuturePParams era) = D1 ('MetaData "FuturePParams" "Cardano.Ledger.State.Governance" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "NoPParamsUpdate" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "DefinitePParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era))) :+: C1 ('MetaCons "PotentialPParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PParams era))))))

nextEpochPParamsEraGov era ⇒ GovState era → PParams era Source #

This function is guaranteed to produce PParams that will be adopted at the next epoch boundary, whenever this function is applied to the GovState that was produced by ledger at any point that is two stability windows before the end of the epoch. If you need to know if there were actual changes to those PParams then use nextEpochUpdatedPParams instead.

nextEpochUpdatedPParamsEraGov era ⇒ GovState era → StrictMaybe (PParams era) Source #

This function is guaranteed to return updated PParams when it is called during the last two stability windows of the epoch and there were proposals to update PParams that all relevant parties reached consensus on. In other words whenever there is a definite update to PParams coming on the epoch boundary those PParams will be returned, otherwise it will return Nothing. This function is inexpensive and can be invoked at any time without danger of forcing some suspended computation.

knownFuturePParamsFuturePParams era → Maybe (PParams era) Source #

Return new PParams only when it is known that there was an update proposed and it is guaranteed to be applied