cardano-ledger-core-1.23.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellNone
LanguageHaskell2010

Cardano.Ledger.State

Synopsis

Documentation

class CanGetAccounts (t ∷ Type → Type) where Source #

Minimal complete definition

Nothing

Methods

accountsG ∷ SimpleGetter (t era) (Accounts era) Source #

default accountsG ∷ CanSetAccounts t ⇒ SimpleGetter (t era) (Accounts era) Source #

Instances

Instances details
CanGetAccounts DState Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

accountsG ∷ SimpleGetter (DState era) (Accounts era) Source #

class CanGetAccounts t ⇒ CanSetAccounts (t ∷ Type → Type) where Source #

Methods

accountsL ∷ Lens' (t era) (Accounts era) Source #

Instances

Instances details
CanSetAccounts DState Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

accountsL ∷ Lens' (DState era) (Accounts era) Source #

class (Era era, Eq (Accounts era), Show (Accounts era), Default (Accounts era), EncCBOR (Accounts era), DecShareCBOR (Accounts era), Share (Accounts era) ~ (Interns (Credential 'Staking), Interns (KeyHash 'StakePool), Interns (Credential 'DRepRole)), ToJSON (Accounts era), NFData (Accounts era), NoThunks (Accounts era), Eq (AccountState era), Show (AccountState era), NFData (AccountState era), NoThunks (AccountState era)) ⇒ EraAccounts era where Source #

Associated Types

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

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

Methods

addAccountState ∷ Credential 'Staking → AccountState era → Accounts era → Accounts era Source #

Add AccountState to Accounts. There are no checks whether account is already registered or not.

accountsMapL ∷ Lens' (Accounts era) (Map (Credential 'Staking) (AccountState era)) Source #

balanceAccountStateL ∷ Lens' (AccountState era) (CompactForm Coin) Source #

depositAccountStateL ∷ Lens' (AccountState era) (CompactForm Coin) Source #

stakePoolDelegationAccountStateL ∷ Lens' (AccountState era) (Maybe (KeyHash 'StakePool)) Source #

unregisterAccount Source #

Arguments

∷ Credential 'Staking

Credential to unregister

→ Accounts era

Accounts to remove the account state from

→ (Maybe (AccountState era), Accounts era)

Returns Just whenever account was registered and Nothing otherwise. Produced Accounts will have the account state removed, if it was present there to begin with.

Remove the account from the state. Note that it is not capable of affecting state for DReps and StakePools, those have to be handled separately.

There is no counterpart for registering an account, because different eras require different information. However for testing purposed there is registerTestAccount that can be used for all eras.

lookupAccountState ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (AccountState era) Source #

Lookup an account state by its credential. Returns Nothing if such account is not registrered

lookupAccountDeposit ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe Coin Source #

Lookup an account state by its credential and return the deposit amount.

updateLookupAccountState ∷ EraAccounts era ⇒ (AccountState era → AccountState era) → Credential 'Staking → Accounts era → (Maybe (AccountState era), Accounts era) Source #

Update account state. Returns Nothing if the value is not present and modified value otherwise

isAccountRegistered ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Bool Source #

Check whether account for this staking credential is registered

lookupStakePoolDelegation ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (KeyHash 'StakePool) Source #

In case when account state is registered and it is delegated to a stake pool this function will return that delegation.

addToBalanceAccounts Source #

Arguments

∷ EraAccounts era 
⇒ Map (Credential 'Staking) (CompactForm Coin)

Map containing amounts that the balance in the account should be increased by. It is important to ensure that all of the credentials in this Map are actually registered.

→ Accounts era

Accounts that will have their balance increased.

→ Accounts era 

Top up balance in accounts

Warning - it is an error to try to increase a balance of an account that is not present in Accounts

withdrawalsThatDoNotDrainAccounts Source #

Arguments

∷ EraAccounts era 
⇒ Withdrawals 
→ Network 
→ Accounts era 
→ Maybe (Withdrawals, Map AccountAddress (Mismatch 'RelEQ Coin))

invalid withdrawal = that which does not have an account address or is in the wrong network. incomplete withdrawal = that which does not withdraw the exact account balance.

This function returns Nothing iff all of the accounts that withdrawals are trying to drain are indeed registered and all of the amounts in the withdrawals match the respective balances exactly. It returns a 2-tuple where the fst is withdrawals with missing account addresses or the wrong network, and snd is incomplete withdrawals.

drainAccounts ∷ EraAccounts era ⇒ Withdrawals → Accounts era → Accounts era Source #

Reset balances to zero for all accounts that are specified in the supplied Withdrawals.

Note - There are no checks that withdrawals mention only registered accounts with correct NetworkId. Nor there are any checks that amounts in withdrawals match up the balance in the corresponding accounts. Verify that it's safe to call on the supplied arguments before calling it.

applyWithdrawals ∷ EraAccounts era ⇒ Withdrawals → Accounts era → Accounts era Source #

Subtract each withdrawal amount from the matching account balance.

Note - No checks on the accounts or amount being withdrawn are made in this function. Verify that it's safe to call on the supplied arguments before calling it.

applyDirectDeposits ∷ EraAccounts era ⇒ DirectDeposits → Accounts era → Accounts era Source #

Add each direct-deposit amount to the matching account balance.

Note - There are no checks that direct deposits mention only registered accounts.

directDepositsMissingAccounts ∷ EraAccounts era ⇒ DirectDeposits → Network → Accounts era → Maybe DirectDeposits Source #

Returns Nothing iff every direct-deposit address is on the supplied network and its credential is registered. Otherwise returns the subset of direct deposits whose address does not resolve — either because the network id does not match, or because the credential is not registered.

withdrawalsMissingAccounts ∷ EraAccounts era ⇒ Withdrawals → Network → Accounts era → Maybe Withdrawals Source #

Returns Nothing iff every withdrawal address resolves to a registered account on the supplied network. Otherwise returns the subset of withdrawals whose address does not resolve — either because the network id does not match, or because the credential is not registered.

removeStakePoolDelegations ∷ EraAccounts era ⇒ Set (Credential 'Staking) → Accounts era → Accounts era Source #

Remove delegations of supplied credentials

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

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

class CanGetChainAccountState (t ∷ Type → Type) where Source #

Minimal complete definition

Nothing

data ChainAccountState Source #

Constructors

ChainAccountState 

Fields

Instances

Instances details
ToJSON ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

DecCBOR ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

EncCBOR ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

ToKeyValuePairs ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ ChainAccountState → [kv] Source #

Default ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

NFData ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

Methods

rnf ∷ ChainAccountState → () #

Generic ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

Associated Types

type Rep ChainAccountState 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

type Rep ChainAccountState = D1 ('MetaData "ChainAccountState" "Cardano.Ledger.State.ChainAccount" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "ChainAccountState" 'PrefixI 'True) (S1 ('MetaSel ('Just "casTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "casReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))
Show ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

Eq ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

NoThunks ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

type Rep ChainAccountState Source # 
Instance details

Defined in Cardano.Ledger.State.ChainAccount

type Rep ChainAccountState = D1 ('MetaData "ChainAccountState" "Cardano.Ledger.State.ChainAccount" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "ChainAccountState" 'PrefixI 'True) (S1 ('MetaSel ('Just "casTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "casReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

treasuryL ∷ ∀ (t ∷ Type → Type) era. CanSetChainAccountState t ⇒ Lens' (t era) Coin Source #

reservesL ∷ ∀ (t ∷ Type → Type) era. CanSetChainAccountState t ⇒ Lens' (t era) Coin Source #

data DRep Source #

Bundled Patterns

pattern DRepCredential ∷ Credential 'DRepRole → DRep 

Instances

Instances details
FromJSON DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

FromJSONKey DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

ToJSON DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

ToJSONKey DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

DecCBOR DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

DecShareCBOR DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Associated Types

type Share DRep 
Instance details

Defined in Cardano.Ledger.DRep

EncCBOR DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

encCBOR ∷ DRep → Encoding Source #

NFData DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

rnf ∷ DRep → () #

Generic DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Associated Types

type Rep DRep 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRep = D1 ('MetaData "DRep" "Cardano.Ledger.DRep" "cardano-ledger-core-1.23.0.0-inplace" 'False) ((C1 ('MetaCons "DRepKeyHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'DRepRole))) :+: C1 ('MetaCons "DRepScriptHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptHash))) :+: (C1 ('MetaCons "DRepAlwaysAbstain" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "DRepAlwaysNoConfidence" 'PrefixI 'False) (U1 ∷ Type → Type)))

Methods

from ∷ DRep → Rep DRep x #

to ∷ Rep DRep x → DRep #

Show DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

showsPrec ∷ Int → DRep → ShowS #

show ∷ DRep → String #

showList ∷ [DRep] → ShowS #

Eq DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

(==) ∷ DRep → DRep → Bool #

(/=) ∷ DRep → DRep → Bool #

Ord DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

compare ∷ DRep → DRep → Ordering #

(<) ∷ DRep → DRep → Bool #

(<=) ∷ DRep → DRep → Bool #

(>) ∷ DRep → DRep → Bool #

(>=) ∷ DRep → DRep → Bool #

max ∷ DRep → DRep → DRep #

min ∷ DRep → DRep → DRep #

NoThunks DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Share DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRep Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRep = D1 ('MetaData "DRep" "Cardano.Ledger.DRep" "cardano-ledger-core-1.23.0.0-inplace" 'False) ((C1 ('MetaCons "DRepKeyHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'DRepRole))) :+: C1 ('MetaCons "DRepScriptHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptHash))) :+: (C1 ('MetaCons "DRepAlwaysAbstain" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "DRepAlwaysNoConfidence" 'PrefixI 'False) (U1 ∷ Type → Type)))

data Anchor Source #

Constructors

Anchor 

Instances

Instances details
FromJSON Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

ToJSON Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

DecCBOR Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

EncCBOR Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

encCBOR ∷ Anchor → Encoding Source #

ToKeyValuePairs Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ Anchor → [kv] Source #

Default Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

def ∷ Anchor Source #

NFData Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

rnf ∷ Anchor → () #

Generic Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Associated Types

type Rep Anchor 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep Anchor = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "anchorUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Url) :*: S1 ('MetaSel ('Just "anchorDataHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SafeHash AnchorData))))

Methods

from ∷ Anchor → Rep Anchor x #

to ∷ Rep Anchor x → Anchor #

Show Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

showsPrec ∷ Int → Anchor → ShowS #

show ∷ Anchor → String #

showList ∷ [Anchor] → ShowS #

Eq Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

(==) ∷ Anchor → Anchor → Bool #

(/=) ∷ Anchor → Anchor → Bool #

Ord Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

compare ∷ Anchor → Anchor → Ordering #

(<) ∷ Anchor → Anchor → Bool #

(<=) ∷ Anchor → Anchor → Bool #

(>) ∷ Anchor → Anchor → Bool #

(>=) ∷ Anchor → Anchor → Bool #

max ∷ Anchor → Anchor → Anchor #

min ∷ Anchor → Anchor → Anchor #

NoThunks Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep Anchor Source # 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep Anchor = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "anchorUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Url) :*: S1 ('MetaSel ('Just "anchorDataHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SafeHash AnchorData))))

data DRepState Source #

Instances

Instances details
FromJSON DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

ToJSON DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

DecCBOR DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

DecShareCBOR DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

Associated Types

type Share DRepState 
Instance details

Defined in Cardano.Ledger.DRep

EncCBOR DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

NFData DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

rnf ∷ DRepState → () #

Generic DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

Associated Types

type Rep DRepState 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRepState = D1 ('MetaData "DRepState" "Cardano.Ledger.DRep" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "DRepState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "drepExpiry") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo) :*: S1 ('MetaSel ('Just "drepAnchor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Anchor))) :*: (S1 ('MetaSel ('Just "drepDeposit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin)) :*: S1 ('MetaSel ('Just "drepDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking))))))

Methods

from ∷ DRepState → Rep DRepState x #

to ∷ Rep DRepState x → DRepState #

Show DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

showsPrec ∷ Int → DRepState → ShowS #

show ∷ DRepState → String #

showList ∷ [DRepState] → ShowS #

Eq DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

Methods

(==) ∷ DRepState → DRepState → Bool #

(/=) ∷ DRepState → DRepState → Bool #

Ord DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

NoThunks DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Share DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRepState Source # 
Instance details

Defined in Cardano.Ledger.DRep

type Rep DRepState = D1 ('MetaData "DRepState" "Cardano.Ledger.DRep" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "DRepState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "drepExpiry") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo) :*: S1 ('MetaSel ('Just "drepAnchor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Anchor))) :*: (S1 ('MetaSel ('Just "drepDeposit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin)) :*: S1 ('MetaSel ('Just "drepDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking))))))

class (EraAccounts era, ToJSON (CertState era), EncCBOR (CertState era), DecShareCBOR (CertState era), Share (CertState era) ~ (Interns (Credential 'Staking), Interns (KeyHash 'StakePool), Interns (Credential 'DRepRole), Interns (Credential 'HotCommitteeRole)), Default (CertState era), NoThunks (CertState era), NFData (CertState era), Show (CertState era), Eq (CertState era)) ⇒ EraCertState era where Source #

The state associated with the DELPL rule, which combines the DELEG rule and the POOL rule.

Associated Types

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

Methods

certDStateL ∷ Lens' (CertState era) (DState era) Source #

certPStateL ∷ Lens' (CertState era) (PState era) Source #

obligationCertState ∷ CertState era → Obligations Source #

Calculate total possible refunds in the system that are related to certificates

There is an invariant that the sum of all the fields should be the same as the utxosDeposited field of the UTxOState. Note that this does not depend upon the current values of the Key and Pool deposits of the PParams.

certsTotalDepositsTxBody ∷ PParams era → CertState era → TxBody 'TopTx era → Coin Source #

Compute the total deposits from the Certs of a TxBody.

This is the contribution of a TxBody towards the deposit pot (utxosDeposit field of the UTxOState) of the system

certsTotalRefundsTxBody ∷ ∀ (t ∷ TxLevel). EraTxBody era ⇒ PParams era → Accounts era → TxBody t era → Coin Source #

Compute the total refunds from the Certs of a TxBody.

This is the contribution of a TxBody towards the total Obligations of the system See Obligations and obligationCertState for more information.

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

data CommitteeAuthorization Source #

Constructors

CommitteeHotCredential !(Credential 'HotCommitteeRole)

Member authorized with a Hot credential acting on behalf of their Cold credential

CommitteeMemberResigned !(StrictMaybe Anchor)

Member resigned with a potential explanation in Anchor

Instances

Instances details
ToJSON CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

DecCBOR CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

EncCBOR CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NFData CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ CommitteeAuthorization → () #

Generic CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep CommitteeAuthorization 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep CommitteeAuthorization = D1 ('MetaData "CommitteeAuthorization" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "CommitteeHotCredential" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Credential 'HotCommitteeRole))) :+: C1 ('MetaCons "CommitteeMemberResigned" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Anchor))))
Show CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Eq CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Ord CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NoThunks CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep CommitteeAuthorization Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep CommitteeAuthorization = D1 ('MetaData "CommitteeAuthorization" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "CommitteeHotCredential" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Credential 'HotCommitteeRole))) :+: C1 ('MetaCons "CommitteeMemberResigned" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Anchor))))

data DState era Source #

The state used by the DELEG rule, which roughly tracks stake delegation and some governance features.

Constructors

DState 

Fields

Instances

Instances details
CanGetAccounts DState Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

accountsG ∷ SimpleGetter (DState era) (Accounts era) Source #

CanSetAccounts DState Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

accountsL ∷ Lens' (DState era) (Accounts era) Source #

ToJSON (Accounts era) ⇒ ToJSON (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

EraAccounts era ⇒ DecShareCBOR (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Share (DState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

getShare ∷ DState era → Share (DState era) Source #

decShareCBOR ∷ Share (DState era) → Decoder s (DState era) Source #

decSharePlusCBOR ∷ StateT (Share (DState era)) (Decoder s) (DState era) Source #

(Era era, EncCBOR (Accounts era)) ⇒ EncCBOR (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

encCBOR ∷ DState era → Encoding Source #

ToJSON (Accounts era) ⇒ ToKeyValuePairs (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ DState era → [kv] Source #

Default (Accounts era) ⇒ Default (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

def ∷ DState era Source #

NFData (Accounts era) ⇒ NFData (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ DState era → () #

Generic (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep (DState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (DState era) = D1 ('MetaData "DState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "DState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dsAccounts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Accounts era)) :*: S1 ('MetaSel ('Just "dsFutureGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FutureGenDeleg GenDelegPair))) :*: (S1 ('MetaSel ('Just "dsGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenDelegs) :*: S1 ('MetaSel ('Just "dsIRewards") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InstantaneousRewards))))

Methods

from ∷ DState era → Rep (DState era) x #

to ∷ Rep (DState era) x → DState era #

Show (Accounts era) ⇒ Show (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

showsPrec ∷ Int → DState era → ShowS #

show ∷ DState era → String #

showList ∷ [DState era] → ShowS #

Eq (Accounts era) ⇒ Eq (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

(==) ∷ DState era → DState era → Bool #

(/=) ∷ DState era → DState era → Bool #

NoThunks (Accounts era) ⇒ NoThunks (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Share (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (DState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (DState era) = D1 ('MetaData "DState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "DState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dsAccounts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Accounts era)) :*: S1 ('MetaSel ('Just "dsFutureGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map FutureGenDeleg GenDelegPair))) :*: (S1 ('MetaSel ('Just "dsGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GenDelegs) :*: S1 ('MetaSel ('Just "dsIRewards") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 InstantaneousRewards))))

data PState era Source #

The state used by the POOL rule, which tracks stake pool information.

Constructors

PState 

Fields

Instances

Instances details
ToJSON (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

(Era era, DecShareCBOR (PState era)) ⇒ DecCBOR (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

decCBOR ∷ Decoder s (PState era) Source #

dropCBOR ∷ Proxy (PState era) → Decoder s () Source #

label ∷ Proxy (PState era) → Text Source #

Era era ⇒ DecShareCBOR (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Share (PState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

getShare ∷ PState era → Share (PState era) Source #

decShareCBOR ∷ Share (PState era) → Decoder s (PState era) Source #

decSharePlusCBOR ∷ StateT (Share (PState era)) (Decoder s) (PState era) Source #

Era era ⇒ EncCBOR (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

encCBOR ∷ PState era → Encoding Source #

ToKeyValuePairs (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ PState era → [kv] Source #

Default (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

def ∷ PState era Source #

NFData (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ PState era → () #

Generic (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep (PState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (PState era) = D1 ('MetaData "PState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "PState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "psVRFKeyHashes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64))) :*: S1 ('MetaSel ('Just "psStakePools") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) StakePoolState))) :*: (S1 ('MetaSel ('Just "psFutureStakePoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) (StakePoolParams era))) :*: S1 ('MetaSel ('Just "psRetiring") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) EpochNo)))))

Methods

from ∷ PState era → Rep (PState era) x #

to ∷ Rep (PState era) x → PState era #

Show (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

showsPrec ∷ Int → PState era → ShowS #

show ∷ PState era → String #

showList ∷ [PState era] → ShowS #

Eq (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

(==) ∷ PState era → PState era → Bool #

(/=) ∷ PState era → PState era → Bool #

NoThunks (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Share (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (PState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (PState era) = D1 ('MetaData "PState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "PState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "psVRFKeyHashes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64))) :*: S1 ('MetaSel ('Just "psStakePools") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) StakePoolState))) :*: (S1 ('MetaSel ('Just "psFutureStakePoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) (StakePoolParams era))) :*: S1 ('MetaSel ('Just "psRetiring") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) EpochNo)))))

data InstantaneousRewards Source #

InstantaneousRewards captures the pending changes to the ledger state caused by MIR certificates. It consists of two mappings, the rewards which will be paid out from the reserves and the rewards which will be paid out from the treasury. It also consists of two coin values which represent the transfer of coins from one pot to the other pot. NOTE that the following property should always hold: deltaReserves + deltaTreasury = 0

Instances

Instances details
ToJSON InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

DecShareCBOR InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

EncCBOR InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

ToKeyValuePairs InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Default InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NFData InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ InstantaneousRewards → () #

Generic InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep InstantaneousRewards 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep InstantaneousRewards = D1 ('MetaData "InstantaneousRewards" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "InstantaneousRewards" 'PrefixI 'True) ((S1 ('MetaSel ('Just "iRReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin)) :*: S1 ('MetaSel ('Just "iRTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin))) :*: (S1 ('MetaSel ('Just "deltaReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "deltaTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin))))
Show InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Eq InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NoThunks InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Share InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep InstantaneousRewards Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep InstantaneousRewards = D1 ('MetaData "InstantaneousRewards" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "InstantaneousRewards" 'PrefixI 'True) ((S1 ('MetaSel ('Just "iRReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin)) :*: S1 ('MetaSel ('Just "iRTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking) Coin))) :*: (S1 ('MetaSel ('Just "deltaReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "deltaTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin))))

data FutureGenDeleg Source #

Instances

Instances details
ToJSON FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

DecCBOR FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

EncCBOR FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NFData FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ FutureGenDeleg → () #

Generic FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep FutureGenDeleg 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep FutureGenDeleg = D1 ('MetaData "FutureGenDeleg" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "FutureGenDeleg" 'PrefixI 'True) (S1 ('MetaSel ('Just "fGenDelegSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "fGenDelegGenKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisRole))))
Show FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Eq FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Ord FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NoThunks FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep FutureGenDeleg Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep FutureGenDeleg = D1 ('MetaData "FutureGenDeleg" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "FutureGenDeleg" 'PrefixI 'True) (S1 ('MetaSel ('Just "fGenDelegSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "fGenDelegGenKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisRole))))

newtype CommitteeState era Source #

Instances

Instances details
ToJSON (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

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

Defined in Cardano.Ledger.State.CertState

Methods

toCBOR ∷ CommitteeState era → Encoding Source #

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

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

Era era ⇒ DecCBOR (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Era era ⇒ DecShareCBOR (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Share (CommitteeState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

EncCBOR (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Default (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

def ∷ CommitteeState era Source #

NFData (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ CommitteeState era → () #

Generic (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep (CommitteeState era) 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (CommitteeState era) = D1 ('MetaData "CommitteeState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "CommitteeState" 'PrefixI 'True) (S1 ('MetaSel ('Just "csCommitteeCreds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (Credential 'ColdCommitteeRole) CommitteeAuthorization))))

Methods

from ∷ CommitteeState era → Rep (CommitteeState era) x #

to ∷ Rep (CommitteeState era) x → CommitteeState era #

Show (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

showsPrec ∷ Int → CommitteeState era → ShowS #

show ∷ CommitteeState era → String #

showList ∷ [CommitteeState era] → ShowS #

Eq (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

(==) ∷ CommitteeState era → CommitteeState era → Bool #

(/=) ∷ CommitteeState era → CommitteeState era → Bool #

Ord (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

NoThunks (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Share (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (CommitteeState era) Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep (CommitteeState era) = D1 ('MetaData "CommitteeState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "CommitteeState" 'PrefixI 'True) (S1 ('MetaSel ('Just "csCommitteeCreds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (Credential 'ColdCommitteeRole) CommitteeAuthorization))))

authorizedHotCommitteeCredentials ∷ CommitteeState era → Set (Credential 'HotCommitteeRole) Source #

Extract all unique hot credential authorizations for the current committee. Note that there is no unique mapping from Hot to Cold credential, therefore we produce a Set, instead of a Map.

lookupDepositDState ∷ EraAccounts era ⇒ DState era → Credential 'Staking → Maybe Coin Source #

Function that looks up the deposit for currently delegated staking credential

lookupRewardDState ∷ EraAccounts era ⇒ DState era → Credential 'Staking → Maybe Coin Source #

Function that looks up curret reward for the delegated staking credential.

data Obligations Source #

A composite of all the Deposits the system is obligated to eventually pay back.

Constructors

Obligations 

Fields

Instances

Instances details
NFData Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Methods

rnf ∷ Obligations → () #

Monoid Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Semigroup Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Generic Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Associated Types

type Rep Obligations 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep Obligations = D1 ('MetaData "Obligations" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "Obligations" 'PrefixI 'True) ((S1 ('MetaSel ('Just "oblStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "oblPool") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "oblDRep") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "oblProposal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))
Show Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Eq Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

Ord Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep Obligations Source # 
Instance details

Defined in Cardano.Ledger.State.CertState

type Rep Obligations = D1 ('MetaData "Obligations" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "Obligations" 'PrefixI 'True) ((S1 ('MetaSel ('Just "oblStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "oblPool") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "oblDRep") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "oblProposal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))

unDelegReDelegStakePool Source #

Arguments

∷ EraAccounts era 
⇒ Credential 'Staking 
→ AccountState era

Account that is losing its current delegation and/or acquiring a new one

→ Maybe (KeyHash 'StakePool)

Optional new delegation target. Use Nothing when the stake credential unregisters.

→ PState era 
→ PState era 

Reverses stake pool delegation. To be called when a stake credential is unregistered or its delegation target changes. If the new delegation matches the previous one, this is a noop.

dsIRewardsL ∷ ∀ era f. Functor f ⇒ (InstantaneousRewards → f InstantaneousRewards) → DState era → f (DState era) Source #

dsGenDelegsL ∷ ∀ era f. Functor f ⇒ (GenDelegs → f GenDelegs) → DState era → f (DState era) Source #

psStakePoolsL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) StakePoolState → f (Map (KeyHash 'StakePool) StakePoolState)) → PState era → f (PState era) Source #

psFutureStakePoolParamsL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) (StakePoolParams era) → f (Map (KeyHash 'StakePool) (StakePoolParams era))) → PState era → f (PState era) Source #

psRetiringL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) EpochNo → f (Map (KeyHash 'StakePool) EpochNo)) → PState era → f (PState era) Source #

addVRFKeyHashOccurrence ∷ VRFVerKeyHash 'StakePoolVRF → Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) → Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) Source #

Record one more reference to a VRF key hash in psVRFKeyHashes. The count saturates at maxBound instead of overflowing.

removeVRFKeyHashOccurrence ∷ VRFVerKeyHash 'StakePoolVRF → Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) → Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) Source #

Drop one reference to a VRF key hash from psVRFKeyHashes. The key is removed once no references remain.

populateVRFKeyHashes ∷ PState era → PState era Source #

Recompute psVRFKeyHashes from scratch out of the registered stake pools: a pool holds one reference through its active parameters and one more through its future parameters whenever those carry a different VRF key hash. It traverses every stake pool, so the rules update the map incrementally instead. This is meant for hard forks and era transitions that have to bring the map into a consistent state, and for assertions that check the incremental updates against it, such as the post-condition of the Dijkstra POOLREAP rule.

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

utxoG ∷ SimpleGetter (UTxO era) (UTxO era) Source #

CanSetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoL ∷ Lens' (UTxO era) (UTxO era) Source #

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

Defined in Cardano.Ledger.State.UTxO

Methods

toJSON ∷ UTxO era → Value Source #

toEncoding ∷ UTxO era → Encoding Source #

toJSONList ∷ [UTxO era] → Value Source #

toEncodingList ∷ [UTxO era] → Encoding Source #

omitField ∷ UTxO era → Bool Source #

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

Defined in Cardano.Ledger.State.UTxO

Methods

fromCBOR ∷ Decoder s (UTxO era) Source #

label ∷ Proxy (UTxO era) → Text Source #

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

Defined in Cardano.Ledger.State.UTxO

Methods

toCBOR ∷ UTxO 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, DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking)) ⇒ DecCBOR (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

decCBOR ∷ Decoder s (UTxO era) Source #

dropCBOR ∷ Proxy (UTxO era) → Decoder s () Source #

label ∷ Proxy (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) 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

getShare ∷ UTxO era → Share (UTxO era) Source #

decShareCBOR ∷ Share (UTxO era) → Decoder s (UTxO era) Source #

decSharePlusCBOR ∷ StateT (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

encCBOR ∷ UTxO era → Encoding Source #

Default (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

def ∷ UTxO era Source #

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

Defined in Cardano.Ledger.State.UTxO

Methods

rnf ∷ UTxO era → () #

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

Defined in Cardano.Ledger.State.UTxO

Methods

mempty ∷ UTxO era #

mappend ∷ UTxO 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 #

sconcat ∷ NonEmpty (UTxO era) → UTxO era #

stimes ∷ Integral b ⇒ b → UTxO era → UTxO era #

Generic (UTxO era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Associated Types

type Rep (UTxO era) 
Instance details

Defined in Cardano.Ledger.State.UTxO

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

Methods

from ∷ UTxO era → Rep (UTxO era) x #

to ∷ Rep (UTxO era) x → UTxO era #

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

Defined in Cardano.Ledger.State.UTxO

Methods

showsPrec ∷ Int → UTxO era → ShowS #

show ∷ UTxO era → String #

showList ∷ [UTxO era] → ShowS #

(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 Share (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.23.0.0-inplace" 'True) (C1 ('MetaCons "UTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "unUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TxIn (TxOut era)))))

getScriptHash ∷ Addr → Maybe ScriptHash Source #

Extract script hash from value address with script.

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

∷ ∀ (t ∷ TxLevel). PParams era 
→ (Credential 'Staking → Maybe Coin)

Function that can lookup current delegation deposits

→ UTxO era 
→ TxBody t era 
→ Value era 

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

getProducedValue Source #

Arguments

∷ PParams era 
→ (KeyHash 'StakePool → Bool)

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

→ TxBody 'TopTx era 
→ Value era 

getScriptsProvided Source #

Arguments

∷ ∀ (t ∷ TxLevel). UTxO era

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

→ Tx t 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.

getScriptsNeeded ∷ ∀ (t ∷ TxLevel). UTxO era → TxBody t 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

getScriptsHashesNeeded ∷ ScriptsNeeded era → Set ScriptHash Source #

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

getWitsVKeyNeeded ∷ ∀ (t ∷ TxLevel). CertState era → UTxO era → TxBody t era → Set (KeyHash 'Witness) Source #

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

getMinFeeTxUtxo ∷ ∀ (t ∷ TxLevel). PParams era → Tx t era → UTxO era → Coin Source #

Minimum fee computation, excluding witnesses and including ref scripts size

class CanGetUTxO (t ∷ Type → Type) where Source #

Minimal complete definition

Nothing

Methods

utxoG ∷ SimpleGetter (t era) (UTxO era) Source #

default utxoG ∷ CanSetUTxO t ⇒ SimpleGetter (t era) (UTxO era) Source #

Instances

Instances details
CanGetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoG ∷ SimpleGetter (UTxO era) (UTxO era) Source #

class CanGetUTxO t ⇒ CanSetUTxO (t ∷ Type → Type) where Source #

Methods

utxoL ∷ Lens' (t era) (UTxO era) Source #

Instances

Instances details
CanSetUTxO UTxO Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

utxoL ∷ Lens' (UTxO era) (UTxO era) Source #

newtype ScriptsProvided era Source #

The only reason it is a newtype instead of just a Map is because for later eras it 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
(Era era, NFData (Script era)) ⇒ NFData (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Methods

rnf ∷ ScriptsProvided era → () #

Generic (ScriptsProvided era) Source # 
Instance details

Defined in Cardano.Ledger.State.UTxO

Associated Types

type Rep (ScriptsProvided era) 
Instance details

Defined in Cardano.Ledger.State.UTxO

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

Methods

from ∷ ScriptsProvided era → Rep (ScriptsProvided era) x #

to ∷ Rep (ScriptsProvided era) x → ScriptsProvided era #

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

Defined in Cardano.Ledger.State.UTxO

Methods

showsPrec ∷ Int → ScriptsProvided era → ShowS #

show ∷ ScriptsProvided era → String #

showList ∷ [ScriptsProvided era] → ShowS #

(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.23.0.0-inplace" 'True) (C1 ('MetaCons "ScriptsProvided" 'PrefixI 'True) (S1 ('MetaSel ('Just "unScriptsProvided") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map ScriptHash (Script era)))))

txins ∷ ∀ era (t ∷ TxLevel). EraTxBody era ⇒ TxBody t era → Set TxIn Source #

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

txinLookup ∷ TxIn → UTxO 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 (l ∷ TxLevel). EraTxBody era ⇒ TxBody l era → UTxO era Source #

Compute the transaction outputs of a transaction.

sumUTxO ∷ EraTxOut era ⇒ UTxO era → Value era Source #

Determine the total balance contained in the UTxO.

sumCoinUTxO ∷ EraTxOut era ⇒ UTxO era → Coin Source #

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

Warning - This function cannot be applied to an untrusted UTxO, since it is susceptible to overflow

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.

Warning - 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.

verifyWitVKey ∷ ∀ (kr ∷ KeyRole). Hash HASH EraIndependentTxBody → WitVKey kr → Bool Source #

Verify a transaction body witness

type family 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.

newtype LeiosCommittee Source #

A Leios epoch's voting committee: an ordered vector of seats (build via mkLeiosCommittee). Order is significant and is used by votes.

Instances

Instances details
DecCBOR LeiosCommittee

Straight to the constructor: mkLeiosCommittee takes proofs of possession, which a seated committee no longer carries.

Instance details

Defined in Cardano.Ledger.Binary.Decoding.DecCBOR

EncCBOR LeiosCommittee

The seats only: a seated committee no longer carries proofs of possession, they were verified when it was selected.

Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

NFData LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

Methods

rnf ∷ LeiosCommittee → () #

Generic LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

Associated Types

type Rep LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosCommittee = D1 ('MetaData "LeiosCommittee" "Cardano.Crypto.Leios" "cardano-crypto-leios-0.3.0.0-c0a9be3efcca80ff1dfd77a51bb2af2628f5823ef58e536e8f12bb68916d2b1d" 'True) (C1 ('MetaCons "UnsafeLeiosCommittee" 'PrefixI 'True) (S1 ('MetaSel ('Just "leiosCommitteeSeats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector LeiosSeat))))
Show LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

Eq LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

NoThunks LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosCommittee 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosCommittee = D1 ('MetaData "LeiosCommittee" "Cardano.Crypto.Leios" "cardano-crypto-leios-0.3.0.0-c0a9be3efcca80ff1dfd77a51bb2af2628f5823ef58e536e8f12bb68916d2b1d" 'True) (C1 ('MetaCons "UnsafeLeiosCommittee" 'PrefixI 'True) (S1 ('MetaSel ('Just "leiosCommitteeSeats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector LeiosSeat))))

data LeiosSeat Source #

A committee seat: a weight and an optional BLS key (e.g. when not yet registered).

Instances

Instances details
DecCBOR LeiosSeat 
Instance details

Defined in Cardano.Ledger.Binary.Decoding.DecCBOR

EncCBOR LeiosSeat 
Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

NFData LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

Methods

rnf ∷ LeiosSeat → () #

Generic LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

Associated Types

type Rep LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosSeat = D1 ('MetaData "LeiosSeat" "Cardano.Crypto.Leios" "cardano-crypto-leios-0.3.0.0-c0a9be3efcca80ff1dfd77a51bb2af2628f5823ef58e536e8f12bb68916d2b1d" 'False) (C1 ('MetaCons "LeiosSeat" 'PrefixI 'True) (S1 ('MetaSel ('Just "seatWeight") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Weight) :*: S1 ('MetaSel ('Just "seatVKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe LeiosVerificationKey))))

Methods

from ∷ LeiosSeat → Rep LeiosSeat x #

to ∷ Rep LeiosSeat x → LeiosSeat #

Show LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

Methods

showsPrec ∷ Int → LeiosSeat → ShowS #

show ∷ LeiosSeat → String #

showList ∷ [LeiosSeat] → ShowS #

Eq LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

Methods

(==) ∷ LeiosSeat → LeiosSeat → Bool #

(/=) ∷ LeiosSeat → LeiosSeat → Bool #

NoThunks LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosSeat 
Instance details

Defined in Cardano.Crypto.Leios

type Rep LeiosSeat = D1 ('MetaData "LeiosSeat" "Cardano.Crypto.Leios" "cardano-crypto-leios-0.3.0.0-c0a9be3efcca80ff1dfd77a51bb2af2628f5823ef58e536e8f12bb68916d2b1d" 'False) (C1 ('MetaCons "LeiosSeat" 'PrefixI 'True) (S1 ('MetaSel ('Just "seatWeight") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Weight) :*: S1 ('MetaSel ('Just "seatVKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe LeiosVerificationKey))))

emptyLeiosCommittee ∷ LeiosCommittee Source #

The committee with no seats: the value for eras before Leios and for a committee size of zero.

data LeiosCandidate Source #

A stake pool standing for committee selection. Keeps selectLeiosCommittee independent of the snapshot the candidates are projected from.

Constructors

LeiosCandidate 

Fields

selectLeiosCommittee ∷ EpochNo → EpochInterval → Word16 → Vector LeiosCandidate → LeiosCommittee Source #

Seat the committeeSize pools with the most stake, largest first, ties broken by ascending pool id. A pool with no registered key, one whose key has aged out (CIP-0164: honoured for maxKeyAge epochs after its registration, judged against the epoch this committee is selected for), or one whose proof of possession does not verify, is seated keyless. A size of zero yields the empty committee without inspecting the candidates, so pre-Dijkstra snapshots carry it for free even when forced.

leiosCommitteeToJSON ∷ LeiosCommittee → Value Source #

Render a LeiosCommittee as JSON for ledger purposes.

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

DecCBOR PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

EncCBOR PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Default PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

def ∷ PoolDistr Source #

NFData PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

rnf ∷ PoolDistr → () #

Generic PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Associated Types

type Rep PoolDistr 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep PoolDistr = D1 ('MetaData "PoolDistr" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.23.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 (NonZero Coin))))

Methods

from ∷ PoolDistr → Rep PoolDistr x #

to ∷ Rep PoolDistr x → PoolDistr #

Show PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

showsPrec ∷ Int → PoolDistr → ShowS #

show ∷ PoolDistr → String #

showList ∷ [PoolDistr] → ShowS #

Eq PoolDistr Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

(==) ∷ PoolDistr → PoolDistr → Bool #

(/=) ∷ PoolDistr → PoolDistr → Bool #

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.23.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 (NonZero Coin))))

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

DecCBOR IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

EncCBOR IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

ToKeyValuePairs IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ IndividualPoolStake → [kv] Source #

NFData IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Methods

rnf ∷ IndividualPoolStake → () #

Generic IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

Associated Types

type Rep IndividualPoolStake 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

type Rep IndividualPoolStake = D1 ('MetaData "IndividualPoolStake" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.23.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)) :*: S1 ('MetaSel ('Just "individualPoolStakeBls") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe BlsKey)))))
Show IndividualPoolStake Source # 
Instance details

Defined in Cardano.Ledger.State.PoolDistr

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.23.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)) :*: S1 ('MetaSel ('Just "individualPoolStakeBls") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe BlsKey)))))

data SnapShots era Source #

Snapshots of the stake distribution.

Note that the snapshot in ssStakeMark, together with the values derived from it, is 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 era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Era era ⇒ DecCBOR (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

decCBOR ∷ Decoder s (SnapShots era) Source #

dropCBOR ∷ Proxy (SnapShots era) → Decoder s () Source #

label ∷ Proxy (SnapShots era) → Text Source #

DecShareCBOR (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share (SnapShots era) 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

encCBOR ∷ SnapShots era → Encoding Source #

ToKeyValuePairs (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ SnapShots era → [kv] Source #

Default (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

def ∷ SnapShots era Source #

NFData (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ SnapShots era → () #

Generic (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep (SnapShots era) 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep (SnapShots era) = D1 ('MetaData "SnapShots" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeMark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MarkSnapShot) :*: S1 ('MetaSel ('Just "ssStakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SetSnapShot)) :*: (S1 ('MetaSel ('Just "ssStakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GoSnapShot) :*: S1 ('MetaSel ('Just "ssFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))

Methods

from ∷ SnapShots era → Rep (SnapShots era) x #

to ∷ Rep (SnapShots era) x → SnapShots era #

Show (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

showsPrec ∷ Int → SnapShots era → ShowS #

show ∷ SnapShots era → String #

showList ∷ [SnapShots era] → ShowS #

Eq (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

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

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

NoThunks (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep (SnapShots era) Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep (SnapShots era) = D1 ('MetaData "SnapShots" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeMark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MarkSnapShot) :*: S1 ('MetaSel ('Just "ssStakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SetSnapShot)) :*: (S1 ('MetaSel ('Just "ssStakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GoSnapShot) :*: S1 ('MetaSel ('Just "ssFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))

sumStakePerPool ∷ VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Coin Source #

Deprecated: As no longer necessary

Compute amount of stake each pool has. Any registered stake pool that has no stake will not be included in the resulting map

data StakePoolSnapShot Source #

This type is the collection of all the necessary data per stake pool that is derived from the StakePoolState, InstantStake and Accounts that is later used for reward calculation

Constructors

StakePoolSnapShot 

Fields

Instances

Instances details
ToJSON StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share StakePoolSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

ToKeyValuePairs StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ StakePoolSnapShot → [kv] Source #

NFData StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ StakePoolSnapShot → () #

Generic StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep StakePoolSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Show StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Eq StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

NoThunks StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep StakePoolSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

mkStakePoolSnapShot Source #

Arguments

∷ ActiveStake

Active Stake

→ NonZero Coin

Total Active Stake

→ StakePoolState

Stake Pool State

→ StakePoolSnapShot 

data SnapShot Source #

Snapshot of the stake distribution.

Constructors

SnapShot 

Fields

Instances

Instances details
ToJSON SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share SnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

ToKeyValuePairs SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ SnapShot → [kv] Source #

NFData SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ SnapShot → () #

Generic SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep SnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SnapShot = D1 ('MetaData "SnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveStake) :*: (S1 ('MetaSel ('Just "ssTotalActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonZero Coin)) :*: S1 ('MetaSel ('Just "ssStakePoolsSnapShot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) StakePoolSnapShot)))))

Methods

from ∷ SnapShot → Rep SnapShot x #

to ∷ Rep SnapShot x → SnapShot #

Show SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

showsPrec ∷ Int → SnapShot → ShowS #

show ∷ SnapShot → String #

showList ∷ [SnapShot] → ShowS #

Eq SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

(==) ∷ SnapShot → SnapShot → Bool #

(/=) ∷ SnapShot → SnapShot → Bool #

NoThunks SnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share 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.23.0.0-inplace" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveStake) :*: (S1 ('MetaSel ('Just "ssTotalActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonZero Coin)) :*: S1 ('MetaSel ('Just "ssStakePoolsSnapShot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) StakePoolSnapShot)))))

leiosCandidates ∷ VMap VB VB (KeyHash 'StakePool) StakePoolSnapShot → Vector LeiosCandidate Source #

Project each stake pool in a snapshot to its standing for Leios committee selection (CIP-0164). selectLeiosCommittee ranks and seats these.

data MarkSnapShot Source #

The freshest snapshot, taken at the boundary into msEpochNo.

It also memoizes, lazily, the pool distribution and the Leios committee it will provide as the SetSnapShot, so they are computed at most once (normally by TICK) and rotation only moves them. See ADR-7.

Construct it with mkMarkSnapShot and change the snapshot with msSnapShotL; record update syntax bypasses the memoization.

Constructors

MarkSnapShot 

Fields

Instances

Instances details
ToJSON MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share MarkSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

ToKeyValuePairs MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ MarkSnapShot → [kv] Source #

NFData MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ MarkSnapShot → () #

Generic MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep MarkSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep MarkSnapShot = D1 ('MetaData "MarkSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "MarkSnapShot" 'PrefixI 'True) ((S1 ('MetaSel ('Just "msSnapShot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "msStakePoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PoolDistr) :*: S1 ('MetaSel ('Just "msEpochNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo))) :*: (S1 ('MetaSel ('Just "msLeiosCommitteeSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16) :*: (S1 ('MetaSel ('Just "msLeiosMaxKeyAge") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochInterval) :*: S1 ('MetaSel ('Just "msLeiosCommittee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LeiosCommittee)))))
Show MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Eq MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

NoThunks MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep MarkSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep MarkSnapShot = D1 ('MetaData "MarkSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "MarkSnapShot" 'PrefixI 'True) ((S1 ('MetaSel ('Just "msSnapShot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "msStakePoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PoolDistr) :*: S1 ('MetaSel ('Just "msEpochNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo))) :*: (S1 ('MetaSel ('Just "msLeiosCommitteeSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16) :*: (S1 ('MetaSel ('Just "msLeiosMaxKeyAge") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochInterval) :*: S1 ('MetaSel ('Just "msLeiosCommittee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LeiosCommittee)))))

mkMarkSnapShot Source #

Arguments

∷ SnapShot 
→ EpochNo

Epoch at the beginning of which the snapshot is taken.

→ Word16

Size of the Leios committee, as set by ppLeiosCommitteeSize. Zero before Dijkstra.

→ EpochInterval

LeiosMaxKeyAgeEpochs. Zero before Dijkstra.

→ MarkSnapShot 

data SetSnapShot Source #

The snapshot that drives leader election (PoolDistr) and Leios voting for the epoch after the one it was marked in.

Constructors

SetSnapShot 

Fields

Instances

Instances details
ToJSON SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share SetSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

ToKeyValuePairs SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ SetSnapShot → [kv] Source #

NFData SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ SetSnapShot → () #

Generic SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep SetSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SetSnapShot = D1 ('MetaData "SetSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "SetSnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssSnapShot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "ssStakePoolDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PoolDistr) :*: S1 ('MetaSel ('Just "ssLeiosCommittee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 LeiosCommittee))))
Show SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Eq SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

NoThunks SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SetSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep SetSnapShot = D1 ('MetaData "SetSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "SetSnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssSnapShot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "ssStakePoolDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PoolDistr) :*: S1 ('MetaSel ('Just "ssLeiosCommittee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 LeiosCommittee))))

mkSetSnapShot ∷ MarkSnapShot → SetSnapShot Source #

Rotate a mark snapshot into the set position. The pool distribution and the Leios committee memoized in the mark snapshot are moved over, which forces them.

newtype GoSnapShot Source #

The oldest snapshot, consumed by the reward calculation.

Constructors

GoSnapShot 

Fields

Instances

Instances details
ToJSON GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

DecShareCBOR GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Share GoSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

EncCBOR GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

ToKeyValuePairs GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

toKeyValuePairs ∷ KeyValue e kv ⇒ GoSnapShot → [kv] Source #

NFData GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

rnf ∷ GoSnapShot → () #

Generic GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Associated Types

type Rep GoSnapShot 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep GoSnapShot = D1 ('MetaData "GoSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "GoSnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "gsSnapShot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot)))
Show GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Eq GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

Methods

(==) ∷ GoSnapShot → GoSnapShot → Bool #

(/=) ∷ GoSnapShot → GoSnapShot → Bool #

NoThunks GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Share GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep GoSnapShot Source # 
Instance details

Defined in Cardano.Ledger.State.SnapShots

type Rep GoSnapShot = D1 ('MetaData "GoSnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "GoSnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "gsSnapShot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot)))

mkGoSnapShot ∷ SetSnapShot → GoSnapShot Source #

Rotate a set snapshot into the go position.

resetStakePoolsSnapShot ∷ VMap VB VB (KeyHash 'StakePool) StakePoolState → SnapShot → SnapShot Source #

Given stake pools state and SnapShot completely overwrite the StakePoolsSnapShot

maxPool ∷ EraPParams era ⇒ PParams era → Coin → Rational → Rational → Coin Source #

Version of maxPool' that extracts ppA0L, ppNOptL and ppMaxPledgeLeverageG from a PParams.

maxPool' ∷ NonNegativeInterval → NonZero Word16 → Coin → Rational → Rational → MaxPledgeLeverage → Coin Source #

Calculate maximal pool reward

calculatePoolStake ∷ (KeyHash 'StakePool → Bool) → ActiveStake → Map (KeyHash 'StakePool) (CompactForm Coin) Source #

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

ssStakeMarkL ∷ ∀ era f. Functor f ⇒ (MarkSnapShot → f MarkSnapShot) → SnapShots era → f (SnapShots era) Source #

ssStakeSetL ∷ ∀ era f. Functor f ⇒ (SetSnapShot → f SetSnapShot) → SnapShots era → f (SnapShots era) Source #

ssStakeGoL ∷ ∀ era f. Functor f ⇒ (GoSnapShot → f GoSnapShot) → SnapShots era → f (SnapShots era) Source #

ssFeeL ∷ ∀ era f. Functor f ⇒ (Coin → f Coin) → SnapShots era → f (SnapShots era) Source #

ssStake ∷ SnapShot → ActiveStake Source #

Deprecated: In favor of ssActiveStake

newtype Stake Source #

Type of stake as map from staking credential to coins associated. Any staking credential that has no stake will not appear in this Map, even if it is registered. For this reason, this data type should not be used for infering whether credential is registered or not.

Constructors

Stake 

Instances

Instances details
ToJSON Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

DecShareCBOR Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Share Stake 
Instance details

Defined in Cardano.Ledger.State.Stake

EncCBOR Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

encCBOR ∷ Stake → Encoding Source #

NFData Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

rnf ∷ Stake → () #

Monoid Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

mempty ∷ Stake #

mappend ∷ Stake → Stake → Stake #

mconcat ∷ [Stake] → Stake #

Semigroup Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

(<>) ∷ Stake → Stake → Stake #

sconcat ∷ NonEmpty Stake → Stake #

stimes ∷ Integral b ⇒ b → Stake → Stake #

Generic Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Rep Stake 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep Stake = D1 ('MetaData "Stake" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "Stake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VP (Credential 'Staking) (CompactForm Coin)))))

Methods

from ∷ Stake → Rep Stake x #

to ∷ Rep Stake x → Stake #

Show Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

showsPrec ∷ Int → Stake → ShowS #

show ∷ Stake → String #

showList ∷ [Stake] → ShowS #

Eq Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

(==) ∷ Stake → Stake → Bool #

(/=) ∷ Stake → Stake → Bool #

NoThunks Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Share Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep Stake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep Stake = D1 ('MetaData "Stake" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "Stake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VP (Credential 'Staking) (CompactForm Coin)))))

data StakeWithDelegation Source #

Combination of non-zero stake with the pool delegation for a single credential.

Instances

Instances details
ToJSON StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

DecCBOR StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

DecShareCBOR StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Share StakeWithDelegation 
Instance details

Defined in Cardano.Ledger.State.Stake

EncCBOR StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

NFData StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

rnf ∷ StakeWithDelegation → () #

Storable StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Generic StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Rep StakeWithDelegation 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep StakeWithDelegation = D1 ('MetaData "StakeWithDelegation" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "StakeWithDelegation" 'PrefixI 'True) (S1 ('MetaSel ('Just "swdStake") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 (NonZero (CompactForm Coin))) :*: S1 ('MetaSel ('Just "swdDelegation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool))))
Show StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Eq StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

NoThunks StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Share StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep StakeWithDelegation Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep StakeWithDelegation = D1 ('MetaData "StakeWithDelegation" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "StakeWithDelegation" 'PrefixI 'True) (S1 ('MetaSel ('Just "swdStake") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 (NonZero (CompactForm Coin))) :*: S1 ('MetaSel ('Just "swdDelegation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool))))

newtype ActiveStake Source #

Active stake: maps staking credentials to their non-zero stake paired with delegation. Only credentials that are registered, delegated, and have non-zero stake appear here.

Instances

Instances details
ToJSON ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

DecShareCBOR ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Share ActiveStake 
Instance details

Defined in Cardano.Ledger.State.Stake

EncCBOR ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

NFData ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Methods

rnf ∷ ActiveStake → () #

Generic ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Associated Types

type Rep ActiveStake 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep ActiveStake = D1 ('MetaData "ActiveStake" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "ActiveStake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unActiveStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VS (Credential 'Staking) StakeWithDelegation))))
Show ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

Eq ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

NoThunks ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Share ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep ActiveStake Source # 
Instance details

Defined in Cardano.Ledger.State.Stake

type Rep ActiveStake = D1 ('MetaData "ActiveStake" "Cardano.Ledger.State.Stake" "cardano-ledger-core-1.23.0.0-inplace" 'True) (C1 ('MetaCons "ActiveStake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unActiveStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VS (Credential 'Staking) StakeWithDelegation))))

sumAllActiveStake ∷ ActiveStake → NonZero Coin Source #

Sum all active stake. Returns NonZero Coin, defaulting to 1 lovelace if empty.

sumCredentialsCompactActiveStake ∷ Foldable f ⇒ ActiveStake → f (Credential 'Staking) → CompactForm Coin Source #

Sum the compact stake for a set of credentials from an ActiveStake.

class (EraAccounts era, Ord (InstantStake era), Show (InstantStake era), Monoid (InstantStake era), Default (InstantStake era), NFData (InstantStake era), NoThunks (InstantStake era), ToJSON (InstantStake era), EncCBOR (InstantStake era), DecShareCBOR (InstantStake era), Share (InstantStake era) ~ Interns (Credential 'Staking)) ⇒ EraStake era where Source #

Associated Types

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

This is the current stake in the system. The important part of this stake is that not all of it is active. Any stake credential that is not registred will not contribute to the active stake, however it will be part of the instant stake. Throughout an epoch it is not relevant which part of the stake is active, because it is only when we take the snaphot that we resolve all the active stake.

Methods

instantStakeCredentialsL ∷ Lens' (InstantStake era) (Map (Credential 'Staking) (CompactForm Coin)) Source #

addInstantStake ∷ UTxO era → InstantStake era → InstantStake era Source #

Add new UTxO to the InstantStake. This is invoked for every new TxOut that is added to the ledger state

deleteInstantStake ∷ UTxO era → InstantStake era → InstantStake era Source #

Delete spent UTxO from the InstantStake. This is invoked for every TxOut that is removed from the ledger state

resolveInstantStake ∷ InstantStake era → Accounts era → ActiveStake Source #

Using known stake credential registrations and delegations resolve the instant stake into ActiveStake that will be used for SnapShot creation by snapShotFromInstantStake.

class CanGetInstantStake (t ∷ Type → Type) where Source #

Minimal complete definition

Nothing

class CanGetInstantStake t ⇒ CanSetInstantStake (t ∷ Type → Type) where Source #

Methods

instantStakeL ∷ Lens' (t era) (InstantStake era) Source #

resolveActiveInstantStakeCredentials ∷ EraStake era ⇒ InstantStake era → Accounts era → Map (Credential 'Staking) StakeWithDelegation Source #

This is the total active stake including the rewards, but ignoring all the stake coming from the pointers. Where "active" stake means any stake credential that is registered and delegated to a stake pool.

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

This is the current stake in the system. The important part of this stake is that not all of it is active. Any stake credential that is not registred will not contribute to the active stake, however it will be part of the instant stake. Throughout an epoch it is not relevant which part of the stake is active, because it is only when we take the snaphot that we resolve all the active stake.

data StakePoolParams era Source #

A stake pool.

Bundled Patterns

pattern PoolParams ∷ KeyHash 'StakePool → VRFVerKeyHash 'StakePoolVRF → StrictMaybe BlsKey → Coin → Coin → UnitInterval → AccountAddress → Set (KeyHash 'Staking) → StrictSeq StakePoolRelay → StrictMaybe PoolMetadata → PoolParams era

Deprecated: In favor of StakePoolParams

Instances

Instances details
FromJSON (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Era era ⇒ DecCBOR (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Default (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

def ∷ StakePoolParams era Source #

NFData (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ StakePoolParams era → () #

Generic (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

from ∷ StakePoolParams era → Rep (StakePoolParams era) x #

to ∷ Rep (StakePoolParams era) x → StakePoolParams era #

Show (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

showsPrec ∷ Int → StakePoolParams era → ShowS #

show ∷ StakePoolParams era → String #

showList ∷ [StakePoolParams era] → ShowS #

Eq (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

(==) ∷ StakePoolParams era → StakePoolParams era → Bool #

(/=) ∷ StakePoolParams era → StakePoolParams era → Bool #

Ord (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NoThunks (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep (StakePoolParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

data StakePoolState Source #

State representation of a stake pool. This type contains all the same information as PoolParams except for the pool ID, which is stored separately as the key in state maps.

Constructors

StakePoolState 

Fields

Instances

Instances details
FromJSON StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecCBOR StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecShareCBOR StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Associated Types

type Share StakePoolState 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Default StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NFData StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ StakePoolState → () #

Generic StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Associated Types

type Rep StakePoolState 
Instance details

Defined in Cardano.Ledger.State.StakePool

Show StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Eq StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Ord StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NoThunks StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Share StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep StakePoolState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

data BlsKey Source #

Instances

Instances details
FromJSON BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecCBOR BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

encCBOR ∷ BlsKey → Encoding Source #

NFData BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ BlsKey → () #

Generic BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Associated Types

type Rep BlsKey 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKey = D1 ('MetaData "BlsKey" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "BlsKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "blsPubKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VerKeyDSIGN BLS12381MinSigDSIGN)) :*: S1 ('MetaSel ('Just "blsPossessionProof") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PossessionProofDSIGN BLS12381MinSigDSIGN))))

Methods

from ∷ BlsKey → Rep BlsKey x #

to ∷ Rep BlsKey x → BlsKey #

Show BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

showsPrec ∷ Int → BlsKey → ShowS #

show ∷ BlsKey → String #

showList ∷ [BlsKey] → ShowS #

Eq BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

(==) ∷ BlsKey → BlsKey → Bool #

(/=) ∷ BlsKey → BlsKey → Bool #

Ord BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

compare ∷ BlsKey → BlsKey → Ordering #

(<) ∷ BlsKey → BlsKey → Bool #

(<=) ∷ BlsKey → BlsKey → Bool #

(>) ∷ BlsKey → BlsKey → Bool #

(>=) ∷ BlsKey → BlsKey → Bool #

max ∷ BlsKey → BlsKey → BlsKey #

min ∷ BlsKey → BlsKey → BlsKey #

NoThunks BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKey Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKey = D1 ('MetaData "BlsKey" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "BlsKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "blsPubKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VerKeyDSIGN BLS12381MinSigDSIGN)) :*: S1 ('MetaSel ('Just "blsPossessionProof") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PossessionProofDSIGN BLS12381MinSigDSIGN))))

data BlsKeyState Source #

A registered voting key, together with the epoch its registration took effect in. The key stops being honoured maxKeyAgeEpochs epochs later, at which point the pool's committee seat is keyless until it registers again.

Constructors

BlsKeyState 

Instances

Instances details
FromJSON BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecCBOR BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NFData BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ BlsKeyState → () #

Generic BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Associated Types

type Rep BlsKeyState 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKeyState = D1 ('MetaData "BlsKeyState" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "BlsKeyState" 'PrefixI 'True) (S1 ('MetaSel ('Just "bksKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlsKey) :*: S1 ('MetaSel ('Just "bksRegisteredIn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)))
Show BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Eq BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Ord BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NoThunks BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKeyState Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep BlsKeyState = D1 ('MetaData "BlsKeyState" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "BlsKeyState" 'PrefixI 'True) (S1 ('MetaSel ('Just "bksKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlsKey) :*: S1 ('MetaSel ('Just "bksRegisteredIn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)))

mkStakePoolState ∷ EpochNo → CompactForm Coin → Set (Credential 'Staking) → StakePoolParams era → StakePoolState Source #

Convert StakePoolParams to StakePoolState by dropping the pool ID. This is the primary way to create a StakePoolState from registration or update parameters. The epoch is the one the parameters take effect in: a voting key carried by the parameters is stamped with it, so registering again renews the key.

stakePoolStateToStakePoolParams ∷ Network → KeyHash 'StakePool → StakePoolState → StakePoolParams era Source #

Convert StakePoolState back to StakePoolParams by providing the pool ID. This is useful when you need to reconstruct the full parameters from the state representation.

withStakePoolParamsFlatEncoding Source #

Arguments

∷ StakePoolParams era 
→ (Int → Encoding → Encoding)

Function with stake pool params flat encoded list length and actual flat encoded stake pool params

→ Encoding 

Returns the StakePoolParams in a flat structure such as `[operator, vrf, pledge, ...]`. Useful for combining with other encoding functions like encodePoolCert so that those functions end up with a flat list encoding instead of a nested list.

We could have used EncCBORGroup to achieve something similar. However, the listLen function is static and can't depend on the Encoding version. Instead, we want StakePoolParams to have a dynamic list length based on the protocol version.

data PoolMetadata Source #

Constructors

PoolMetadata 

Fields

Instances

Instances details
FromJSON PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecCBOR PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NFData PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ PoolMetadata → () #

Generic PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Associated Types

type Rep PoolMetadata 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep PoolMetadata = D1 ('MetaData "PoolMetadata" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "PoolMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "pmUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Url) :*: S1 ('MetaSel ('Just "pmHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteArray)))
Show PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Eq PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Ord PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NoThunks PoolMetadata Source #

Check WHNF by pattern-matching on both fields, since they both are strict, and just contain ByteArray#

Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep PoolMetadata Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep PoolMetadata = D1 ('MetaData "PoolMetadata" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.23.0.0-inplace" 'False) (C1 ('MetaCons "PoolMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "pmUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Url) :*: S1 ('MetaSel ('Just "pmHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteArray)))

data StakePoolRelay Source #

Constructors

SingleHostAddr !(StrictMaybe Port) !(StrictMaybe IPv4) !(StrictMaybe IPv6)

One or both of IPv4 & IPv6

SingleHostName !(StrictMaybe Port) !DnsName

An A or AAAA DNS record

MultiHostName !DnsName

A SRV DNS record

Instances

Instances details
FromJSON StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

ToJSON StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

DecCBOR StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

EncCBOR StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NFData StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Methods

rnf ∷ StakePoolRelay → () #

Generic StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Show StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Eq StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

Ord StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

NoThunks StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

type Rep StakePoolRelay Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

data SizeOfPoolRelays Source #

The size of the sppRelays Set. Only used to compute size of encoded StakePoolParams.

Constructors

SizeOfPoolRelays 

Instances

Instances details
EncCBOR SizeOfPoolRelays Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

data SizeOfPoolOwners Source #

The size of the sppOwners Set. Only used to compute size of encoded StakePoolParams.

Constructors

SizeOfPoolOwners 

Instances

Instances details
EncCBOR SizeOfPoolOwners Source # 
Instance details

Defined in Cardano.Ledger.State.StakePool

sppCostL ∷ ∀ era f. Functor f ⇒ (Coin → f Coin) → StakePoolParams era → f (StakePoolParams era) Source #

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

emptyGovState ∷ GovState era Source #

Construct empty governance state

curPParamsGovStateL ∷ Lens' (GovState era) (PParams era) Source #

Lens for accessing current protocol parameters

prevPParamsGovStateL ∷ Lens' (GovState era) (PParams era) Source #

Lens for accessing the previous protocol parameters

futurePParamsGovStateL ∷ Lens' (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.

obligationGovState ∷ GovState 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

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

Defined in Cardano.Ledger.State.Governance

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

Defined in Cardano.Ledger.State.Governance

Default (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Methods

def ∷ FuturePParams era Source #

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

Defined in Cardano.Ledger.State.Governance

Methods

rnf ∷ FuturePParams era → () #

Generic (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.State.Governance

Associated Types

type Rep (FuturePParams era) 
Instance details

Defined in Cardano.Ledger.State.Governance

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

Methods

from ∷ FuturePParams era → Rep (FuturePParams era) x #

to ∷ Rep (FuturePParams era) x → FuturePParams era #

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

Defined in Cardano.Ledger.State.Governance

Methods

showsPrec ∷ Int → FuturePParams era → ShowS #

show ∷ FuturePParams era → String #

showList ∷ [FuturePParams era] → ShowS #

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 #

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

Defined in Cardano.Ledger.State.Governance

Methods

compare ∷ FuturePParams era → FuturePParams era → Ordering #

(<) ∷ FuturePParams era → FuturePParams era → Bool #

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

(>) ∷ FuturePParams era → FuturePParams era → Bool #

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

max ∷ FuturePParams era → FuturePParams era → FuturePParams era #

min ∷ FuturePParams era → FuturePParams era → FuturePParams era #

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.23.0.0-inplace" 'False) (C1 ('MetaCons "NoPParamsUpdate" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "DefinitePParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era))) :+: C1 ('MetaCons "PotentialPParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PParams era))))))

nextEpochPParams ∷ EraGov 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.

nextEpochUpdatedPParams ∷ EraGov 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.

knownFuturePParams ∷ FuturePParams 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

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