Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data CertState era = CertState {
- certVState ∷ !(VState era)
- certPState ∷ !(PState era)
- certDState ∷ !(DState era)
- data CommitteeAuthorization
- data DState era = DState {}
- data PState era = PState {
- psStakePoolParams ∷ !(Map (KeyHash 'StakePool) PoolParams)
- psFutureStakePoolParams ∷ !(Map (KeyHash 'StakePool) PoolParams)
- psRetiring ∷ !(Map (KeyHash 'StakePool) EpochNo)
- psDeposits ∷ !(Map (KeyHash 'StakePool) Coin)
- data VState era = VState {
- vsDReps ∷ !(Map (Credential 'DRepRole) DRepState)
- vsCommitteeState ∷ !(CommitteeState era)
- vsNumDormantEpochs ∷ !EpochNo
- data InstantaneousRewards = InstantaneousRewards {
- iRReserves ∷ !(Map (Credential 'Staking) Coin)
- iRTreasury ∷ !(Map (Credential 'Staking) Coin)
- deltaReserves ∷ !DeltaCoin
- deltaTreasury ∷ !DeltaCoin
- data FutureGenDeleg = FutureGenDeleg {}
- data Anchor = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash AnchorData)
- data DRepState = DRepState {
- drepExpiry ∷ !EpochNo
- drepAnchor ∷ !(StrictMaybe Anchor)
- drepDeposit ∷ !Coin
- drepDelegs ∷ !(Set (Credential 'Staking))
- data DRep where
- newtype CommitteeState era = CommitteeState {}
- authorizedHotCommitteeCredentials ∷ CommitteeState era → Set (Credential 'HotCommitteeRole)
- data AnchorData
- lookupDepositDState ∷ DState era → StakeCredential → Maybe Coin
- lookupRewardDState ∷ DState era → StakeCredential → Maybe Coin
- rewards ∷ DState era → UView (Credential 'Staking) RDPair
- delegations ∷ DState era → UView (Credential 'Staking) (KeyHash 'StakePool)
- ptrsMap ∷ DState era → Map Ptr (Credential 'Staking)
- payPoolDeposit ∷ EraPParams era ⇒ KeyHash 'StakePool → PParams era → PState era → PState era
- refundPoolDeposit ∷ KeyHash 'StakePool → PState era → (Coin, PState era)
- obligationCertState ∷ CertState era → Obligations
- data Obligations = Obligations {}
- sumObligation ∷ Obligations → Coin
- certsTotalDepositsTxBody ∷ EraTxBody era ⇒ PParams era → CertState era → TxBody era → Coin
- certsTotalRefundsTxBody ∷ EraTxBody era ⇒ PParams era → CertState era → TxBody era → Coin
- certDStateL ∷ Lens' (CertState era) (DState era)
- certPStateL ∷ Lens' (CertState era) (PState era)
- certVStateL ∷ Lens' (CertState era) (VState era)
- dsUnifiedL ∷ Lens' (DState era) UMap
- dsGenDelegsL ∷ Lens' (DState era) GenDelegs
- dsIRewardsL ∷ Lens' (DState era) InstantaneousRewards
- dsFutureGenDelegsL ∷ Lens' (DState era) (Map FutureGenDeleg GenDelegPair)
- psStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) PoolParams)
- psFutureStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) PoolParams)
- psRetiringL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) EpochNo)
- psDepositsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) Coin)
- vsDRepsL ∷ Lens' (VState era) (Map (Credential 'DRepRole) DRepState)
- vsCommitteeStateL ∷ Lens' (VState era) (CommitteeState era)
- vsNumDormantEpochsL ∷ Lens' (VState era) EpochNo
- vsActualDRepExpiry ∷ Credential 'DRepRole → VState era → Maybe EpochNo
- csCommitteeCredsL ∷ Lens' (CommitteeState era) (Map (Credential 'ColdCommitteeRole) CommitteeAuthorization)
- lookupDepositVState ∷ VState era → Credential 'DRepRole → Maybe Coin
Documentation
The state associated with the DELPL rule, which combines the DELEG rule and the POOL rule.
CertState | |
|
Instances
ToJSON (CertState era) Source # | |
Generic (CertState era) Source # | |
Show (CertState era) Source # | |
Era era ⇒ DecShareCBOR (CertState era) Source # | |
Era era ⇒ EncCBOR (CertState era) Source # | |
Default (CertState era) Source # | |
Defined in Cardano.Ledger.CertState | |
NFData (CertState era) Source # | |
Defined in Cardano.Ledger.CertState | |
Eq (CertState era) Source # | |
NoThunks (CertState era) Source # | |
type Rep (CertState era) Source # | |
Defined in Cardano.Ledger.CertState type Rep (CertState era) = D1 ('MetaData "CertState" "Cardano.Ledger.CertState" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "CertState" 'PrefixI 'True) (S1 ('MetaSel ('Just "certVState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VState era)) :*: (S1 ('MetaSel ('Just "certPState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PState era)) :*: S1 ('MetaSel ('Just "certDState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DState era))))) | |
type Share (CertState era) Source # | |
data CommitteeAuthorization Source #
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
The state used by the DELEG rule, which roughly tracks stake delegation and some governance features.
DState | |
|
Instances
The state used by the POOL rule, which tracks stake pool information.
PState | |
|
Instances
The state that tracks the voting entities (DReps and Constitutional Committee
members). In the formal ledger specification this type is called GState
VState | |
|
Instances
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
InstantaneousRewards | |
|
Instances
data FutureGenDeleg Source #
Instances
Anchor | |
|
Instances
FromJSON Anchor Source # | |
ToJSON Anchor Source # | |
Generic Anchor Source # | |
Show Anchor Source # | |
DecCBOR Anchor Source # | |
EncCBOR Anchor Source # | |
Default Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes | |
NFData Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Anchor Source # | |
Ord Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes | |
NoThunks Anchor Source # | |
type Rep Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep Anchor = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.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)))) |
DRepState | |
|
Instances
FromJSON DRepState Source # | |
ToJSON DRepState Source # | |
Generic DRepState Source # | |
Show DRepState Source # | |
DecCBOR DRepState Source # | |
EncCBOR DRepState Source # | |
NFData DRepState Source # | |
Defined in Cardano.Ledger.DRep | |
Eq DRepState Source # | |
Ord DRepState Source # | |
Defined in Cardano.Ledger.DRep | |
NoThunks DRepState Source # | |
type Rep DRepState Source # | |
Defined in Cardano.Ledger.DRep type Rep DRepState = D1 ('MetaData "DRepState" "Cardano.Ledger.DRep" "cardano-ledger-core-1.17.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 Coin) :*: S1 ('MetaSel ('Just "drepDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking)))))) |
DRepKeyHash !(KeyHash 'DRepRole) | |
DRepScriptHash !ScriptHash | |
DRepAlwaysAbstain | |
DRepAlwaysNoConfidence |
pattern DRepCredential ∷ Credential 'DRepRole → DRep |
Instances
FromJSON DRep Source # | |
FromJSONKey DRep Source # | |
ToJSON DRep Source # | |
ToJSONKey DRep Source # | |
Defined in Cardano.Ledger.DRep | |
Generic DRep Source # | |
Show DRep Source # | |
DecCBOR DRep Source # | |
EncCBOR DRep Source # | |
NFData DRep Source # | |
Defined in Cardano.Ledger.DRep | |
Eq DRep Source # | |
Ord DRep Source # | |
NoThunks DRep Source # | |
type Rep DRep Source # | |
Defined in Cardano.Ledger.DRep type Rep DRep = D1 ('MetaData "DRep" "Cardano.Ledger.DRep" "cardano-ledger-core-1.17.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))) |
newtype CommitteeState era Source #
Instances
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.
data AnchorData Source #
Instances
SafeToHash AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes (==) ∷ AnchorData → AnchorData → Bool Source # (/=) ∷ AnchorData → AnchorData → Bool Source # | |
HashAnnotated AnchorData AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes |
lookupDepositDState ∷ DState era → StakeCredential → Maybe Coin Source #
Function that looks up the deposit for currently delegated staking credential
lookupRewardDState ∷ DState era → StakeCredential → Maybe Coin Source #
Function that looks up curret reward for the delegated staking credential.
delegations ∷ DState era → UView (Credential 'Staking) (KeyHash 'StakePool) Source #
ptrsMap ∷ DState era → Map Ptr (Credential 'Staking) Source #
get the actual ptrs map, we don't need a view
payPoolDeposit ∷ EraPParams era ⇒ KeyHash 'StakePool → PParams era → PState era → PState era Source #
One only pays a deposit on the initial pool registration. So return the the Deposits unchanged if the keyhash already exists. There are legal situations where a pool may be registered multiple times.
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.
data Obligations Source #
A composite of all the Deposits the system is obligated to eventually pay back.
Instances
certsTotalDepositsTxBody ∷ EraTxBody era ⇒ PParams era → CertState era → TxBody 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 ∷ EraTxBody era ⇒ PParams era → CertState era → TxBody 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.
dsIRewardsL ∷ Lens' (DState era) InstantaneousRewards Source #
dsFutureGenDelegsL ∷ Lens' (DState era) (Map FutureGenDeleg GenDelegPair) Source #
psStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) PoolParams) Source #
psFutureStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool) PoolParams) Source #
vsCommitteeStateL ∷ Lens' (VState era) (CommitteeState era) Source #
vsActualDRepExpiry ∷ Credential 'DRepRole → VState era → Maybe EpochNo Source #
csCommitteeCredsL ∷ Lens' (CommitteeState era) (Map (Credential 'ColdCommitteeRole) CommitteeAuthorization) Source #
lookupDepositVState ∷ VState era → Credential 'DRepRole → Maybe Coin Source #
Function that looks up the deposit for currently registered DRep