Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data CertState era = CertState {
- certVState ∷ !(VState era)
- certPState ∷ !(PState era)
- certDState ∷ !(DState era)
- data CommitteeAuthorization c
- data DState era = DState {
- dsUnified ∷ !(UMap (EraCrypto era))
- dsFutureGenDelegs ∷ !(Map (FutureGenDeleg (EraCrypto era)) (GenDelegPair (EraCrypto era)))
- dsGenDelegs ∷ !(GenDelegs (EraCrypto era))
- dsIRewards ∷ !(InstantaneousRewards (EraCrypto era))
- data PState era = PState {
- psStakePoolParams ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- psFutureStakePoolParams ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- psRetiring ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) EpochNo)
- psDeposits ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) Coin)
- data VState era = VState {
- vsDReps ∷ !(Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- vsCommitteeState ∷ !(CommitteeState era)
- vsNumDormantEpochs ∷ !EpochNo
- data InstantaneousRewards c = InstantaneousRewards {
- iRReserves ∷ !(Map (Credential 'Staking c) Coin)
- iRTreasury ∷ !(Map (Credential 'Staking c) Coin)
- deltaReserves ∷ !DeltaCoin
- deltaTreasury ∷ !DeltaCoin
- data FutureGenDeleg c = FutureGenDeleg {
- fGenDelegSlot ∷ !SlotNo
- fGenDelegGenKeyHash ∷ !(KeyHash 'Genesis c)
- data Anchor c = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash c AnchorData)
- data DRepState c = DRepState {
- drepExpiry ∷ !EpochNo
- drepAnchor ∷ !(StrictMaybe (Anchor c))
- drepDeposit ∷ !Coin
- drepDelegs ∷ !(Set (Credential 'Staking c))
- data DRep c where
- DRepKeyHash !(KeyHash 'DRepRole c)
- DRepScriptHash !(ScriptHash c)
- DRepAlwaysAbstain
- DRepAlwaysNoConfidence
- pattern DRepCredential ∷ Credential 'DRepRole c → DRep c
- newtype CommitteeState era = CommitteeState {
- csCommitteeCreds ∷ Map (Credential 'ColdCommitteeRole (EraCrypto era)) (CommitteeAuthorization (EraCrypto era))
- authorizedHotCommitteeCredentials ∷ CommitteeState era → Set (Credential 'HotCommitteeRole (EraCrypto era))
- data AnchorData
- lookupDepositDState ∷ DState era → StakeCredential (EraCrypto era) → Maybe Coin
- lookupRewardDState ∷ DState era → StakeCredential (EraCrypto era) → Maybe Coin
- rewards ∷ DState era → UView (EraCrypto era) (Credential 'Staking (EraCrypto era)) RDPair
- delegations ∷ DState era → UView (EraCrypto era) (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era))
- ptrsMap ∷ DState era → Map Ptr (Credential 'Staking (EraCrypto era))
- payPoolDeposit ∷ EraPParams era ⇒ KeyHash 'StakePool (EraCrypto era) → PParams era → PState era → PState era
- refundPoolDeposit ∷ KeyHash 'StakePool (EraCrypto era) → 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 (EraCrypto era))
- dsGenDelegsL ∷ Lens' (DState era) (GenDelegs (EraCrypto era))
- dsIRewardsL ∷ Lens' (DState era) (InstantaneousRewards (EraCrypto era))
- dsFutureGenDelegsL ∷ Lens' (DState era) (Map (FutureGenDeleg (EraCrypto era)) (GenDelegPair (EraCrypto era)))
- psStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- psFutureStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- psRetiringL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) EpochNo)
- psDepositsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) Coin)
- vsDRepsL ∷ Lens' (VState era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- vsCommitteeStateL ∷ Lens' (VState era) (CommitteeState era)
- vsNumDormantEpochsL ∷ Lens' (VState era) EpochNo
- vsActualDRepExpiry ∷ Credential 'DRepRole (EraCrypto era) → VState era → Maybe EpochNo
- csCommitteeCredsL ∷ Lens' (CommitteeState era) (Map (Credential 'ColdCommitteeRole (EraCrypto era)) (CommitteeAuthorization (EraCrypto era)))
- lookupDepositVState ∷ VState era → Credential 'DRepRole (EraCrypto era) → Maybe Coin
Documentation
The state associated with the DELPL rule, which combines the DELEG rule and the POOL rule.
CertState | |
|
Instances
data CommitteeAuthorization c Source #
CommitteeHotCredential !(Credential 'HotCommitteeRole c) | Member authorized with a Hot credential acting on behalf of their Cold credential |
CommitteeMemberResigned !(StrictMaybe (Anchor c)) | 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 c 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 c Source #
Instances
Anchor | |
|
Instances
Crypto c ⇒ FromJSON (Anchor c) Source # | |
Crypto c ⇒ ToJSON (Anchor c) Source # | |
Generic (Anchor c) Source # | |
Show (Anchor c) Source # | |
Crypto c ⇒ DecCBOR (Anchor c) Source # | |
Crypto c ⇒ EncCBOR (Anchor c) Source # | |
Crypto c ⇒ Default (Anchor c) Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Crypto c ⇒ NFData (Anchor c) Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq (Anchor c) Source # | |
Ord (Anchor c) Source # | |
NoThunks (Anchor c) Source # | |
type Rep (Anchor c) Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep (Anchor c) = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.16.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 c AnchorData)))) |
DRepState | |
|
Instances
DRepKeyHash !(KeyHash 'DRepRole c) | |
DRepScriptHash !(ScriptHash c) | |
DRepAlwaysAbstain | |
DRepAlwaysNoConfidence |
pattern DRepCredential ∷ Credential 'DRepRole c → DRep c |
Instances
newtype CommitteeState era Source #
CommitteeState | |
|
Instances
authorizedHotCommitteeCredentials ∷ CommitteeState era → Set (Credential 'HotCommitteeRole (EraCrypto era)) 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 originalBytes ∷ AnchorData → ByteString Source # originalBytesSize ∷ AnchorData → Int Source # makeHashWithExplicitProxys ∷ HashAlgorithm (HASH c) ⇒ Proxy c → Proxy index → AnchorData → SafeHash c index Source # | |
Eq AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes (==) ∷ AnchorData → AnchorData → Bool Source # (/=) ∷ AnchorData → AnchorData → Bool Source # | |
HashWithCrypto AnchorData AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes hashWithCrypto ∷ HashAlgorithm (HASH c) ⇒ Proxy c → AnchorData → SafeHash c AnchorData Source # |
lookupDepositDState ∷ DState era → StakeCredential (EraCrypto era) → Maybe Coin Source #
Function that looks up the deposit for currently delegated staking credential
lookupRewardDState ∷ DState era → StakeCredential (EraCrypto era) → Maybe Coin Source #
Function that looks up curret reward for the delegated staking credential.
delegations ∷ DState era → UView (EraCrypto era) (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era)) Source #
ptrsMap ∷ DState era → Map Ptr (Credential 'Staking (EraCrypto era)) Source #
get the actual ptrs map, we don't need a view
payPoolDeposit ∷ EraPParams era ⇒ KeyHash 'StakePool (EraCrypto era) → 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 (EraCrypto era)) Source #
dsFutureGenDelegsL ∷ Lens' (DState era) (Map (FutureGenDeleg (EraCrypto era)) (GenDelegPair (EraCrypto era))) Source #
psStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))) Source #
psFutureStakePoolParamsL ∷ Lens' (PState era) (Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))) Source #
vsDRepsL ∷ Lens' (VState era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era))) Source #
vsCommitteeStateL ∷ Lens' (VState era) (CommitteeState era) Source #
vsActualDRepExpiry ∷ Credential 'DRepRole (EraCrypto era) → VState era → Maybe EpochNo Source #
csCommitteeCredsL ∷ Lens' (CommitteeState era) (Map (Credential 'ColdCommitteeRole (EraCrypto era)) (CommitteeAuthorization (EraCrypto era))) Source #
lookupDepositVState ∷ VState era → Credential 'DRepRole (EraCrypto era) → Maybe Coin Source #
Function that looks up the deposit for currently registered DRep