| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.State
Synopsis
- class CanGetAccounts (t ∷ Type → Type) where
- accountsG ∷ SimpleGetter (t era) (Accounts era)
- class CanGetAccounts t ⇒ CanSetAccounts (t ∷ Type → Type) where
- 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
- type AccountState era = (r ∷ Type) | r → era
- type Accounts era = (r ∷ Type) | r → era
- addAccountState ∷ Credential 'Staking → AccountState era → Accounts era → Accounts era
- accountsMapL ∷ Lens' (Accounts era) (Map (Credential 'Staking) (AccountState era))
- balanceAccountStateL ∷ Lens' (AccountState era) (CompactForm Coin)
- depositAccountStateL ∷ Lens' (AccountState era) (CompactForm Coin)
- stakePoolDelegationAccountStateL ∷ Lens' (AccountState era) (Maybe (KeyHash 'StakePool))
- unregisterAccount ∷ Credential 'Staking → Accounts era → (Maybe (AccountState era), Accounts era)
- lookupAccountState ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (AccountState era)
- lookupAccountStateIntern ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (Credential 'Staking, AccountState era)
- updateLookupAccountState ∷ EraAccounts era ⇒ (AccountState era → AccountState era) → Credential 'Staking → Accounts era → (Maybe (AccountState era), Accounts era)
- isAccountRegistered ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Bool
- adjustAccountState ∷ EraAccounts era ⇒ (AccountState era → AccountState era) → Credential 'Staking → Accounts era → Accounts era
- lookupStakePoolDelegation ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (KeyHash 'StakePool)
- sumBalancesAccounts ∷ EraAccounts era ⇒ Accounts era → Coin
- sumDepositsAccounts ∷ EraAccounts era ⇒ Accounts era → Coin
- addToBalanceAccounts ∷ EraAccounts era ⇒ Map (Credential 'Staking) (CompactForm Coin) → Accounts era → Accounts era
- withdrawalsThatDoNotDrainAccounts ∷ EraAccounts era ⇒ Withdrawals → Network → Accounts era → Maybe (Withdrawals, Withdrawals)
- drainAccounts ∷ EraAccounts era ⇒ Withdrawals → Accounts era → Accounts era
- removeStakePoolDelegations ∷ EraAccounts era ⇒ Set (Credential 'Staking) → Accounts era → Accounts era
- type family Accounts era = (r ∷ Type) | r → era
- type family AccountState era = (r ∷ Type) | r → era
- class CanGetChainAccountState (t ∷ Type → Type) where
- chainAccountStateG ∷ SimpleGetter (t era) ChainAccountState
- class CanGetChainAccountState t ⇒ CanSetChainAccountState (t ∷ Type → Type) where
- chainAccountStateL ∷ Lens' (t era) ChainAccountState
- data ChainAccountState = ChainAccountState {
- casTreasury ∷ !Coin
- casReserves ∷ !Coin
- casTreasuryL ∷ Lens' ChainAccountState Coin
- casReservesL ∷ Lens' ChainAccountState Coin
- treasuryL ∷ ∀ (t ∷ Type → Type) era. CanSetChainAccountState t ⇒ Lens' (t era) Coin
- reservesL ∷ ∀ (t ∷ Type → Type) era. CanSetChainAccountState t ⇒ Lens' (t era) Coin
- data DRep where
- data Anchor = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash AnchorData)
- data AnchorData
- data DRepState = DRepState {
- drepExpiry ∷ !EpochNo
- drepAnchor ∷ !(StrictMaybe Anchor)
- drepDeposit ∷ !(CompactForm Coin)
- drepDelegs ∷ !(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
- type CertState era = (r ∷ Type) | r → era
- certDStateL ∷ Lens' (CertState era) (DState era)
- certPStateL ∷ Lens' (CertState era) (PState era)
- obligationCertState ∷ CertState era → Obligations
- certsTotalDepositsTxBody ∷ ∀ (t ∷ TxLevel). EraTxBody era ⇒ PParams era → CertState era → TxBody t era → Coin
- certsTotalRefundsTxBody ∷ ∀ (t ∷ TxLevel). EraTxBody era ⇒ PParams era → CertState era → TxBody t era → Coin
- type family CertState era = (r ∷ Type) | r → era
- data CommitteeAuthorization
- data DState era = DState {}
- data PState era = PState {
- psVRFKeyHashes ∷ !(Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64))
- psStakePools ∷ !(Map (KeyHash 'StakePool) StakePoolState)
- psFutureStakePoolParams ∷ !(Map (KeyHash 'StakePool) StakePoolParams)
- psRetiring ∷ !(Map (KeyHash 'StakePool) EpochNo)
- data InstantaneousRewards = InstantaneousRewards {
- iRReserves ∷ !(Map (Credential 'Staking) Coin)
- iRTreasury ∷ !(Map (Credential 'Staking) Coin)
- deltaReserves ∷ !DeltaCoin
- deltaTreasury ∷ !DeltaCoin
- data FutureGenDeleg = FutureGenDeleg {}
- newtype CommitteeState era = CommitteeState {}
- authorizedHotCommitteeCredentials ∷ CommitteeState era → Set (Credential 'HotCommitteeRole)
- lookupDepositDState ∷ EraAccounts era ⇒ DState era → StakeCredential → Maybe Coin
- lookupRewardDState ∷ EraAccounts era ⇒ DState era → StakeCredential → Maybe Coin
- data Obligations = Obligations {}
- sumObligation ∷ Obligations → Coin
- unDelegReDelegStakePool ∷ EraAccounts era ⇒ Credential 'Staking → AccountState era → Maybe (KeyHash 'StakePool) → PState era → PState era
- iRReservesL ∷ Lens' InstantaneousRewards (Map (Credential 'Staking) Coin)
- dsIRewardsL ∷ ∀ era f. Functor f ⇒ (InstantaneousRewards → f InstantaneousRewards) → DState era → f (DState era)
- dsGenDelegsL ∷ ∀ era f. Functor f ⇒ (GenDelegs → f GenDelegs) → DState era → f (DState era)
- iRTreasuryL ∷ Lens' InstantaneousRewards (Map (Credential 'Staking) Coin)
- iRDeltaReservesL ∷ Lens' InstantaneousRewards DeltaCoin
- iRDeltaTreasuryL ∷ Lens' InstantaneousRewards DeltaCoin
- dsFutureGenDelegsL ∷ ∀ era f. Functor f ⇒ (Map FutureGenDeleg GenDelegPair → f (Map FutureGenDeleg GenDelegPair)) → DState era → f (DState era)
- psStakePoolsL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) StakePoolState → f (Map (KeyHash 'StakePool) StakePoolState)) → PState era → f (PState era)
- psFutureStakePoolParamsL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) StakePoolParams → f (Map (KeyHash 'StakePool) StakePoolParams)) → PState era → f (PState era)
- psRetiringL ∷ ∀ era f. Functor f ⇒ (Map (KeyHash 'StakePool) EpochNo → f (Map (KeyHash 'StakePool) EpochNo)) → PState era → f (PState era)
- psVRFKeyHashesL ∷ ∀ era f. Functor f ⇒ (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) → f (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64))) → PState era → f (PState era)
- newtype UTxO era = UTxO {}
- getScriptHash ∷ Addr → Maybe ScriptHash
- class EraTx era ⇒ EraUTxO era where
- type ScriptsNeeded era = (r ∷ Type) | r → era
- consumed ∷ ∀ (t ∷ TxLevel). PParams era → CertState era → UTxO era → TxBody t era → Value era
- getConsumedValue ∷ ∀ (t ∷ TxLevel). PParams era → (Credential 'Staking → Maybe Coin) → (Credential 'DRepRole → Maybe Coin) → UTxO era → TxBody t era → Value era
- getProducedValue ∷ ∀ (t ∷ TxLevel). PParams era → (KeyHash 'StakePool → Bool) → TxBody t era → Value era
- getScriptsProvided ∷ ∀ (t ∷ TxLevel). UTxO era → Tx t era → ScriptsProvided era
- getScriptsNeeded ∷ ∀ (t ∷ TxLevel). UTxO era → TxBody t era → ScriptsNeeded era
- getScriptsHashesNeeded ∷ ScriptsNeeded era → Set ScriptHash
- getWitsVKeyNeeded ∷ ∀ (t ∷ TxLevel). CertState era → UTxO era → TxBody t era → Set (KeyHash 'Witness)
- getMinFeeTxUtxo ∷ ∀ (t ∷ TxLevel). PParams era → Tx t era → UTxO era → Coin
- class CanGetUTxO (t ∷ Type → Type) where
- utxoG ∷ SimpleGetter (t era) (UTxO era)
- class CanGetUTxO t ⇒ CanSetUTxO (t ∷ Type → Type) where
- newtype ScriptsProvided era = ScriptsProvided {
- unScriptsProvided ∷ Map ScriptHash (Script era)
- txins ∷ ∀ era (t ∷ TxLevel). EraTxBody era ⇒ TxBody t era → Set TxIn
- txinLookup ∷ TxIn → UTxO era → Maybe (TxOut era)
- txInsFilter ∷ UTxO era → Set TxIn → UTxO era
- txouts ∷ ∀ era (l ∷ TxLevel). EraTxBody era ⇒ TxBody l era → UTxO era
- sumUTxO ∷ EraTxOut era ⇒ UTxO era → Value era
- sumCoinUTxO ∷ EraTxOut era ⇒ UTxO era → Coin
- sumAllValue ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Value era
- sumAllCoin ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Coin
- areAllAdaOnly ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Bool
- verifyWitVKey ∷ ∀ (kr ∷ KeyRole). Hash HASH EraIndependentTxBody → WitVKey kr → Bool
- type family ScriptsNeeded era = (r ∷ Type) | r → era
- data PoolDistr = PoolDistr {}
- data IndividualPoolStake = IndividualPoolStake {}
- poolDistrDistrL ∷ Lens' PoolDistr (Map (KeyHash 'StakePool) IndividualPoolStake)
- poolDistrTotalL ∷ Lens' PoolDistr (CompactForm Coin)
- individualTotalPoolStakeL ∷ Lens' IndividualPoolStake (CompactForm Coin)
- data SnapShots = SnapShots {}
- newtype Stake = Stake {
- unStake ∷ VMap VB VP (Credential 'Staking) (CompactForm Coin)
- sumAllStake ∷ Stake → Coin
- sumAllStakeCompact ∷ Stake → CompactForm Coin
- sumStakePerPool ∷ VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Coin
- data SnapShot = SnapShot {
- ssStake ∷ !Stake
- ssDelegations ∷ !(VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))
- ssPoolParams ∷ !(VMap VB VB (KeyHash 'StakePool) StakePoolParams)
- emptySnapShot ∷ SnapShot
- emptySnapShots ∷ SnapShots
- poolStake ∷ KeyHash 'StakePool → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Stake
- maxPool ∷ EraPParams era ⇒ PParams era → Coin → Rational → Rational → Coin
- maxPool' ∷ NonNegativeInterval → NonZero Word16 → Coin → Rational → Rational → Coin
- calculatePoolDistr ∷ SnapShot → PoolDistr
- calculatePoolDistr' ∷ (KeyHash 'StakePool → Bool) → SnapShot → PoolDistr
- calculatePoolStake ∷ (KeyHash 'StakePool → Bool) → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Word64
- ssStakeMarkL ∷ Lens' SnapShots SnapShot
- ssStakeMarkPoolDistrL ∷ Lens' SnapShots PoolDistr
- ssStakeSetL ∷ Lens' SnapShots SnapShot
- ssStakeGoL ∷ Lens' SnapShots SnapShot
- ssFeeL ∷ Lens' SnapShots Coin
- ssStakeL ∷ Lens' SnapShot Stake
- ssStakeDistrL ∷ Lens' SnapShot (VMap VB VP (Credential 'Staking) (CompactForm Coin))
- ssDelegationsL ∷ Lens' SnapShot (VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))
- ssPoolParamsL ∷ Lens' SnapShot (VMap VB VB (KeyHash 'StakePool) StakePoolParams)
- class (EraAccounts era, Eq (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
- type InstantStake era = (r ∷ Type) | r → era
- instantStakeCredentialsL ∷ Lens' (InstantStake era) (Map (Credential 'Staking) (CompactForm Coin))
- addInstantStake ∷ UTxO era → InstantStake era → InstantStake era
- deleteInstantStake ∷ UTxO era → InstantStake era → InstantStake era
- resolveInstantStake ∷ InstantStake era → Accounts era → Stake
- class CanGetInstantStake (t ∷ Type → Type) where
- instantStakeG ∷ SimpleGetter (t era) (InstantStake era)
- class CanGetInstantStake t ⇒ CanSetInstantStake (t ∷ Type → Type) where
- instantStakeL ∷ Lens' (t era) (InstantStake era)
- snapShotFromInstantStake ∷ EraStake era ⇒ InstantStake era → DState era → PState era → SnapShot
- resolveActiveInstantStakeCredentials ∷ EraStake era ⇒ InstantStake era → Accounts era → Map (Credential 'Staking) (CompactForm Coin)
- type family InstantStake era = (r ∷ Type) | r → era
- data StakePoolParams where
- StakePoolParams {
- sppId ∷ !(KeyHash 'StakePool)
- sppVrf ∷ !(VRFVerKeyHash 'StakePoolVRF)
- sppPledge ∷ !Coin
- sppCost ∷ !Coin
- sppMargin ∷ !UnitInterval
- sppRewardAccount ∷ !RewardAccount
- sppOwners ∷ !(Set (KeyHash 'Staking))
- sppRelays ∷ !(StrictSeq StakePoolRelay)
- sppMetadata ∷ !(StrictMaybe PoolMetadata)
- pattern PoolParams ∷ KeyHash 'StakePool → VRFVerKeyHash 'StakePoolVRF → Coin → Coin → UnitInterval → RewardAccount → Set (KeyHash 'Staking) → StrictSeq StakePoolRelay → StrictMaybe PoolMetadata → PoolParams
- StakePoolParams {
- data StakePoolState = StakePoolState {
- spsVrf ∷ !(VRFVerKeyHash 'StakePoolVRF)
- spsPledge ∷ !Coin
- spsCost ∷ !Coin
- spsMargin ∷ !UnitInterval
- spsRewardAccount ∷ !RewardAccount
- spsOwners ∷ !(Set (KeyHash 'Staking))
- spsRelays ∷ !(StrictSeq StakePoolRelay)
- spsMetadata ∷ !(StrictMaybe PoolMetadata)
- spsDeposit ∷ !(CompactForm Coin)
- spsDelegators ∷ !(Set (Credential 'Staking))
- spsDelegatorsL ∷ Lens' StakePoolState (Set (Credential 'Staking))
- stakePoolStateToStakePoolParams ∷ KeyHash 'StakePool → StakePoolState → StakePoolParams
- spsVrfL ∷ Lens' StakePoolState (VRFVerKeyHash 'StakePoolVRF)
- spsPledgeL ∷ Lens' StakePoolState Coin
- spsCostL ∷ Lens' StakePoolState Coin
- spsMarginL ∷ Lens' StakePoolState UnitInterval
- spsRewardAccountL ∷ Lens' StakePoolState RewardAccount
- spsOwnersL ∷ Lens' StakePoolState (Set (KeyHash 'Staking))
- spsRelaysL ∷ Lens' StakePoolState (StrictSeq StakePoolRelay)
- spsMetadataL ∷ Lens' StakePoolState (StrictMaybe PoolMetadata)
- spsDepositL ∷ Lens' StakePoolState (CompactForm Coin)
- mkStakePoolState ∷ CompactForm Coin → Set (Credential 'Staking) → StakePoolParams → StakePoolState
- data PoolMetadata = PoolMetadata {
- pmUrl ∷ !Url
- pmHash ∷ !ByteString
- data StakePoolRelay
- = SingleHostAddr !(StrictMaybe Port) !(StrictMaybe IPv4) !(StrictMaybe IPv6)
- | SingleHostName !(StrictMaybe Port) !DnsName
- | MultiHostName !DnsName
- data SizeOfPoolRelays = SizeOfPoolRelays
- data SizeOfPoolOwners = SizeOfPoolOwners
- sppCostL ∷ Lens' StakePoolParams Coin
- sppMetadataL ∷ Lens' StakePoolParams (StrictMaybe PoolMetadata)
- sppVrfL ∷ Lens' StakePoolParams (VRFVerKeyHash 'StakePoolVRF)
- 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
- type GovState era = (r ∷ Type) | r → era
- emptyGovState ∷ GovState era
- curPParamsGovStateL ∷ Lens' (GovState era) (PParams era)
- prevPParamsGovStateL ∷ Lens' (GovState era) (PParams era)
- futurePParamsGovStateL ∷ Lens' (GovState era) (FuturePParams era)
- obligationGovState ∷ GovState era → Obligations
- data FuturePParams era
- = NoPParamsUpdate
- | DefinitePParamsUpdate !(PParams era)
- | PotentialPParamsUpdate (Maybe (PParams era))
- solidifyFuturePParams ∷ FuturePParams era → FuturePParams era
- nextEpochPParams ∷ EraGov era ⇒ GovState era → PParams era
- nextEpochUpdatedPParams ∷ EraGov era ⇒ GovState era → StrictMaybe (PParams era)
- knownFuturePParams ∷ FuturePParams era → Maybe (PParams era)
- type family GovState era = (r ∷ Type) | r → era
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
| CanGetAccounts DState Source # | |
Defined in Cardano.Ledger.State.CertState | |
class CanGetAccounts t ⇒ CanSetAccounts (t ∷ Type → Type) where 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 #
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 #
Arguments
| ∷ Credential 'Staking | Credential to unregister |
| → Accounts era |
|
| → (Maybe (AccountState era), Accounts era) | Returns |
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
lookupAccountStateIntern ∷ EraAccounts era ⇒ Credential 'Staking → Accounts era → Maybe (Credential 'Staking, AccountState era) Source #
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
adjustAccountState ∷ EraAccounts era ⇒ (AccountState era → AccountState era) → Credential 'Staking → Accounts era → Accounts era Source #
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.
sumBalancesAccounts ∷ EraAccounts era ⇒ Accounts era → Coin Source #
sumDepositsAccounts ∷ EraAccounts era ⇒ Accounts era → Coin 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, Withdrawals) | invalid withdrawal = that which does not have a reward account 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 reward accounts or the wrong network,
and snd is incomplete withdrawals.
NOTE: We simply checkBadWithdrawals to avoid allocating new variables for
the most likely case.
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. Use withdrawalsThatDoNotDrainAccounts to verify that calling
drainAccounts is actually safe on the supplied arguments
removeStakePoolDelegations ∷ EraAccounts era ⇒ Set (Credential 'Staking) → Accounts era → Accounts era Source #
Remove delegations of supplied credentials
type family AccountState era = (r ∷ Type) | r → era Source #
class CanGetChainAccountState (t ∷ Type → Type) where Source #
Minimal complete definition
Nothing
Methods
chainAccountStateG ∷ SimpleGetter (t era) ChainAccountState Source #
default chainAccountStateG ∷ CanSetChainAccountState t ⇒ SimpleGetter (t era) ChainAccountState Source #
class CanGetChainAccountState t ⇒ CanSetChainAccountState (t ∷ Type → Type) where Source #
Methods
chainAccountStateL ∷ Lens' (t era) ChainAccountState Source #
data ChainAccountState Source #
Constructors
| ChainAccountState | |
Fields
| |
Instances
Constructors
| DRepKeyHash !(KeyHash 'DRepRole) | |
| DRepScriptHash !ScriptHash | |
| DRepAlwaysAbstain | |
| DRepAlwaysNoConfidence |
Bundled Patterns
| pattern DRepCredential ∷ Credential 'DRepRole → DRep |
Instances
| FromJSON DRep Source # | |||||
| FromJSONKey DRep Source # | |||||
Defined in Cardano.Ledger.DRep | |||||
| ToJSON DRep Source # | |||||
| ToJSONKey DRep Source # | |||||
Defined in Cardano.Ledger.DRep | |||||
| DecCBOR DRep Source # | |||||
| DecShareCBOR DRep Source # | |||||
| EncCBOR DRep Source # | |||||
| NFData DRep Source # | |||||
Defined in Cardano.Ledger.DRep | |||||
| Generic DRep Source # | |||||
Defined in Cardano.Ledger.DRep Associated Types
| |||||
| Show DRep Source # | |||||
| Eq DRep Source # | |||||
| Ord DRep Source # | |||||
| NoThunks DRep Source # | |||||
| type Share DRep Source # | |||||
| type Rep DRep Source # | |||||
Defined in Cardano.Ledger.DRep type Rep DRep = D1 ('MetaData "DRep" "Cardano.Ledger.DRep" "cardano-ledger-core-1.19.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))) | |||||
Constructors
| Anchor | |
Fields
| |
Instances
| FromJSON Anchor Source # | |||||
| ToJSON Anchor Source # | |||||
| DecCBOR Anchor Source # | |||||
| EncCBOR Anchor Source # | |||||
| ToKeyValuePairs Anchor Source # | |||||
Defined in Cardano.Ledger.BaseTypes Methods toKeyValuePairs ∷ KeyValue e kv ⇒ Anchor → [kv] Source # | |||||
| Default Anchor Source # | |||||
Defined in Cardano.Ledger.BaseTypes | |||||
| NFData Anchor Source # | |||||
Defined in Cardano.Ledger.BaseTypes | |||||
| Generic Anchor Source # | |||||
Defined in Cardano.Ledger.BaseTypes Associated Types
| |||||
| Show Anchor Source # | |||||
| Eq Anchor Source # | |||||
| Ord Anchor Source # | |||||
| 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.19.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 AnchorData Source #
Instances
| SafeToHash AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes Methods originalBytes ∷ AnchorData → ByteString Source # originalBytesSize ∷ AnchorData → Int Source # makeHashWithExplicitProxys ∷ Proxy i → AnchorData → SafeHash i Source # | |
| Eq AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes | |
| HashAnnotated AnchorData AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes Methods | |
Constructors
| DRepState | |
Fields
| |
Instances
| FromJSON DRepState Source # | |||||
| ToJSON DRepState Source # | |||||
| DecCBOR DRepState Source # | |||||
| DecShareCBOR DRepState Source # | |||||
| EncCBOR DRepState Source # | |||||
| NFData DRepState Source # | |||||
Defined in Cardano.Ledger.DRep | |||||
| Generic DRepState Source # | |||||
Defined in Cardano.Ledger.DRep Associated Types
| |||||
| Show DRepState Source # | |||||
| Eq DRepState Source # | |||||
| Ord DRepState Source # | |||||
Defined in Cardano.Ledger.DRep | |||||
| NoThunks DRepState Source # | |||||
| type Share DRepState Source # | |||||
| type Rep DRepState Source # | |||||
Defined in Cardano.Ledger.DRep type Rep DRepState = D1 ('MetaData "DRepState" "Cardano.Ledger.DRep" "cardano-ledger-core-1.19.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.
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 ∷ ∀ (t ∷ TxLevel). EraTxBody era ⇒ PParams era → CertState era → TxBody t 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 → CertState 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.
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
| ToJSON CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| DecCBOR CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| EncCBOR CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods | |||||
| NFData CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods rnf ∷ CommitteeAuthorization → () # | |||||
| Generic CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
Methods from ∷ CommitteeAuthorization → Rep CommitteeAuthorization x # to ∷ Rep CommitteeAuthorization x → CommitteeAuthorization # | |||||
| Show CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods showsPrec ∷ Int → CommitteeAuthorization → ShowS # show ∷ CommitteeAuthorization → String # showList ∷ [CommitteeAuthorization] → ShowS # | |||||
| Eq CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods (==) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # (/=) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # | |||||
| Ord CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods compare ∷ CommitteeAuthorization → CommitteeAuthorization → Ordering # (<) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # (<=) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # (>) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # (>=) ∷ CommitteeAuthorization → CommitteeAuthorization → Bool # max ∷ CommitteeAuthorization → CommitteeAuthorization → CommitteeAuthorization # min ∷ CommitteeAuthorization → CommitteeAuthorization → CommitteeAuthorization # | |||||
| NoThunks CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| type Rep CommitteeAuthorization Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep CommitteeAuthorization = D1 ('MetaData "CommitteeAuthorization" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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)))) | |||||
The state used by the DELEG rule, which roughly tracks stake delegation and some governance features.
Constructors
| DState | |
Fields
| |
Instances
| CanGetAccounts DState Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| CanSetAccounts DState Source # | |||||
| ToJSON (Accounts era) ⇒ ToJSON (DState era) Source # | |||||
| EraAccounts era ⇒ DecShareCBOR (DState era) Source # | |||||
| (Era era, EncCBOR (Accounts era)) ⇒ EncCBOR (DState era) Source # | |||||
| ToJSON (Accounts era) ⇒ ToKeyValuePairs (DState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods toKeyValuePairs ∷ KeyValue e kv ⇒ DState era → [kv] Source # | |||||
| Default (Accounts era) ⇒ Default (DState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| NFData (Accounts era) ⇒ NFData (DState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| Generic (DState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
| |||||
| Show (Accounts era) ⇒ Show (DState era) Source # | |||||
| Eq (Accounts era) ⇒ Eq (DState era) Source # | |||||
| NoThunks (Accounts era) ⇒ NoThunks (DState era) Source # | |||||
| type Share (DState era) Source # | |||||
| type Rep (DState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep (DState era) = D1 ('MetaData "DState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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)))) | |||||
The state used by the POOL rule, which tracks stake pool information.
Constructors
| PState | |
Fields
| |
Instances
| ToJSON (PState era) Source # | |||||
| (Era era, DecShareCBOR (PState era)) ⇒ DecCBOR (PState era) Source # | |||||
| DecShareCBOR (PState era) Source # | |||||
| Era era ⇒ EncCBOR (PState era) Source # | |||||
| ToKeyValuePairs (PState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods toKeyValuePairs ∷ KeyValue e kv ⇒ PState era → [kv] Source # | |||||
| Default (PState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| NFData (PState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| Generic (PState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
| |||||
| Show (PState era) Source # | |||||
| Eq (PState era) Source # | |||||
| NoThunks (PState era) Source # | |||||
| type Share (PState era) Source # | |||||
| type Rep (PState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep (PState era) = D1 ('MetaData "PState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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)) :*: 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
Constructors
| InstantaneousRewards | |
Fields
| |
Instances
| ToJSON InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| DecShareCBOR InstantaneousRewards Source # | |||||
| EncCBOR InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods | |||||
| ToKeyValuePairs InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods toKeyValuePairs ∷ KeyValue e kv ⇒ InstantaneousRewards → [kv] Source # | |||||
| Default InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods | |||||
| NFData InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods rnf ∷ InstantaneousRewards → () # | |||||
| Generic InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
Methods | |||||
| Show InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods showsPrec ∷ Int → InstantaneousRewards → ShowS # show ∷ InstantaneousRewards → String # showList ∷ [InstantaneousRewards] → ShowS # | |||||
| Eq InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods | |||||
| NoThunks InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| type Share InstantaneousRewards Source # | |||||
| type Rep InstantaneousRewards Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep InstantaneousRewards = D1 ('MetaData "InstantaneousRewards" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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 #
Constructors
| FutureGenDeleg | |
Fields
| |
Instances
| ToJSON FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods toJSON ∷ FutureGenDeleg → Value Source # toEncoding ∷ FutureGenDeleg → Encoding Source # toJSONList ∷ [FutureGenDeleg] → Value Source # | |||||
| DecCBOR FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| EncCBOR FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods | |||||
| NFData FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods rnf ∷ FutureGenDeleg → () # | |||||
| Generic FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
| |||||
| Show FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods showsPrec ∷ Int → FutureGenDeleg → ShowS # show ∷ FutureGenDeleg → String # showList ∷ [FutureGenDeleg] → ShowS # | |||||
| Eq FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods (==) ∷ FutureGenDeleg → FutureGenDeleg → Bool # (/=) ∷ FutureGenDeleg → FutureGenDeleg → Bool # | |||||
| Ord FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods compare ∷ FutureGenDeleg → FutureGenDeleg → Ordering # (<) ∷ FutureGenDeleg → FutureGenDeleg → Bool # (<=) ∷ FutureGenDeleg → FutureGenDeleg → Bool # (>) ∷ FutureGenDeleg → FutureGenDeleg → Bool # (>=) ∷ FutureGenDeleg → FutureGenDeleg → Bool # | |||||
| NoThunks FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| type Rep FutureGenDeleg Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep FutureGenDeleg = D1 ('MetaData "FutureGenDeleg" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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 'Genesis)))) | |||||
newtype CommitteeState era Source #
Constructors
| CommitteeState | |
Instances
| ToJSON (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods toJSON ∷ CommitteeState era → Value Source # toEncoding ∷ CommitteeState era → Encoding Source # toJSONList ∷ [CommitteeState era] → Value Source # toEncodingList ∷ [CommitteeState era] → Encoding Source # omitField ∷ CommitteeState era → Bool Source # | |||||
| Era era ⇒ ToCBOR (CommitteeState era) Source # | |||||
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 # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| Era era ⇒ DecShareCBOR (CommitteeState era) Source # | |||||
| EncCBOR (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods encCBOR ∷ CommitteeState era → Encoding Source # | |||||
| Default (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods def ∷ CommitteeState era Source # | |||||
| NFData (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods rnf ∷ CommitteeState era → () # | |||||
| Generic (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
Methods from ∷ CommitteeState era → Rep (CommitteeState era) x # to ∷ Rep (CommitteeState era) x → CommitteeState era # | |||||
| Show (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods showsPrec ∷ Int → CommitteeState era → ShowS # show ∷ CommitteeState era → String # showList ∷ [CommitteeState era] → ShowS # | |||||
| Eq (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods (==) ∷ CommitteeState era → CommitteeState era → Bool # (/=) ∷ CommitteeState era → CommitteeState era → Bool # | |||||
| Ord (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods compare ∷ CommitteeState era → CommitteeState era → Ordering # (<) ∷ CommitteeState era → CommitteeState era → Bool # (<=) ∷ CommitteeState era → CommitteeState era → Bool # (>) ∷ CommitteeState era → CommitteeState era → Bool # (>=) ∷ CommitteeState era → CommitteeState era → Bool # max ∷ CommitteeState era → CommitteeState era → CommitteeState era # min ∷ CommitteeState era → CommitteeState era → CommitteeState era # | |||||
| NoThunks (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| type Share (CommitteeState era) Source # | |||||
| type Rep (CommitteeState era) Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep (CommitteeState era) = D1 ('MetaData "CommitteeState" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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 → StakeCredential → Maybe Coin Source #
Function that looks up the deposit for currently delegated staking credential
lookupRewardDState ∷ EraAccounts era ⇒ DState era → StakeCredential → 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 | |
Instances
| NFData Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods rnf ∷ Obligations → () # | |||||
| Monoid Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| Semigroup Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods (<>) ∷ Obligations → Obligations → Obligations # sconcat ∷ NonEmpty Obligations → Obligations # stimes ∷ Integral b ⇒ b → Obligations → Obligations # | |||||
| Generic Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState Associated Types
| |||||
| Show Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods showsPrec ∷ Int → Obligations → ShowS # show ∷ Obligations → String # showList ∷ [Obligations] → ShowS # | |||||
| Eq Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState | |||||
| Ord Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState Methods compare ∷ Obligations → Obligations → Ordering # (<) ∷ Obligations → Obligations → Bool # (<=) ∷ Obligations → Obligations → Bool # (>) ∷ Obligations → Obligations → Bool # (>=) ∷ Obligations → Obligations → Bool # max ∷ Obligations → Obligations → Obligations # min ∷ Obligations → Obligations → Obligations # | |||||
| type Rep Obligations Source # | |||||
Defined in Cardano.Ledger.State.CertState type Rep Obligations = D1 ('MetaData "Obligations" "Cardano.Ledger.State.CertState" "cardano-ledger-core-1.19.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 |
| → 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 #
dsFutureGenDelegsL ∷ ∀ era f. Functor f ⇒ (Map FutureGenDeleg GenDelegPair → f (Map FutureGenDeleg GenDelegPair)) → 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 → f (Map (KeyHash 'StakePool) StakePoolParams)) → 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 #
psVRFKeyHashesL ∷ ∀ era f. Functor f ⇒ (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64) → f (Map (VRFVerKeyHash 'StakePoolVRF) (NonZero Word64))) → PState era → f (PState era) Source #
The unspent transaction outputs.
Instances
| CanGetUTxO UTxO Source # | |||||
Defined in Cardano.Ledger.State.UTxO | |||||
| CanSetUTxO UTxO Source # | |||||
| ToJSON (TxOut era) ⇒ ToJSON (UTxO era) Source # | |||||
| (DecCBOR (TxOut era), Era era) ⇒ FromCBOR (UTxO era) Source # | |||||
| (EncCBOR (TxOut era), Era era) ⇒ ToCBOR (UTxO era) Source # | |||||
| (Era era, DecCBOR (TxOut era)) ⇒ DecCBOR (UTxO era) Source # | |||||
| (DecShareCBOR (TxOut era), Share (TxOut era) ~ Interns (Credential 'Staking)) ⇒ DecShareCBOR (UTxO era) Source # | |||||
| (Era era, EncCBOR (TxOut era)) ⇒ EncCBOR (UTxO era) Source # | |||||
| Default (UTxO era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO | |||||
| (Era era, NFData (TxOut era)) ⇒ NFData (UTxO era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO | |||||
| Era era ⇒ Monoid (UTxO era) Source # | |||||
| Semigroup (UTxO era) Source # | |||||
| Generic (UTxO era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO Associated Types
| |||||
| Show (TxOut era) ⇒ Show (UTxO era) Source # | |||||
| (Era era, Eq (TxOut era)) ⇒ Eq (UTxO era) Source # | |||||
| NoThunks (TxOut era) ⇒ NoThunks (UTxO era) Source # | |||||
| type Share (UTxO era) Source # | |||||
| type Rep (UTxO era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO | |||||
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
consumed ∷ ∀ (t ∷ TxLevel). PParams era → CertState era → UTxO era → TxBody t era → Value era Source #
Arguments
| ∷ ∀ (t ∷ TxLevel). PParams era | |
| → (Credential 'Staking → Maybe Coin) | Function that can lookup current delegation deposits |
| → (Credential 'DRepRole → Maybe Coin) | Function that can lookup current drep deposits |
| → UTxO era | |
| → TxBody t era | |
| → Value era |
Calculate all the value that is being consumed by the transaction.
Arguments
| ∷ ∀ (t ∷ TxLevel). PParams era | |
| → (KeyHash 'StakePool → Bool) | Check whether a pool with a supplied PoolStakeId is already registered. |
| → TxBody t era | |
| → Value era |
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
| CanGetUTxO UTxO Source # | |
Defined in Cardano.Ledger.State.UTxO | |
class CanGetUTxO t ⇒ CanSetUTxO (t ∷ Type → Type) where Source #
newtype ScriptsProvided era Source #
The only reason it is a newtype instead of just a Map is becuase for later eras is expensive to compute the actual map, so we want to use the type safety guidance to avoid redundant work.
Constructors
| ScriptsProvided | |
Fields
| |
Instances
| (Era era, NFData (Script era)) ⇒ NFData (ScriptsProvided era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO Methods rnf ∷ ScriptsProvided era → () # | |||||
| Generic (ScriptsProvided era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO Associated Types
Methods from ∷ ScriptsProvided era → Rep (ScriptsProvided era) x # to ∷ Rep (ScriptsProvided era) x → ScriptsProvided era # | |||||
| (Era era, Show (Script era)) ⇒ Show (ScriptsProvided era) Source # | |||||
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 # | |||||
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 # | |||||
Defined in Cardano.Ledger.State.UTxO Methods compare ∷ ScriptsProvided era → ScriptsProvided era → Ordering # (<) ∷ ScriptsProvided era → ScriptsProvided era → Bool # (<=) ∷ ScriptsProvided era → ScriptsProvided era → Bool # (>) ∷ ScriptsProvided era → ScriptsProvided era → Bool # (>=) ∷ ScriptsProvided era → ScriptsProvided era → Bool # max ∷ ScriptsProvided era → ScriptsProvided era → ScriptsProvided era # min ∷ ScriptsProvided era → ScriptsProvided era → ScriptsProvided era # | |||||
| type Rep (ScriptsProvided era) Source # | |||||
Defined in Cardano.Ledger.State.UTxO type Rep (ScriptsProvided era) = D1 ('MetaData "ScriptsProvided" "Cardano.Ledger.State.UTxO" "cardano-ledger-core-1.19.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.
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.
sumAllValue ∷ (EraTxOut era, Foldable f) ⇒ f (TxOut era) → Value era Source #
Sum all the value in any Foldable with 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.
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
| ToJSON PoolDistr Source # | |||||
| DecCBOR PoolDistr Source # | |||||
| EncCBOR PoolDistr Source # | |||||
| Default PoolDistr Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr | |||||
| NFData PoolDistr Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr | |||||
| Generic PoolDistr Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Associated Types
| |||||
| Show PoolDistr Source # | |||||
| Eq PoolDistr Source # | |||||
| NoThunks PoolDistr Source # | |||||
| type Rep PoolDistr Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr type Rep PoolDistr = D1 ('MetaData "PoolDistr" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "PoolDistr" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPoolDistr") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) IndividualPoolStake)) :*: S1 ('MetaSel ('Just "pdTotalActiveStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin)))) | |||||
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
| ToJSON IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr | |||||
| DecCBOR IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr | |||||
| EncCBOR IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Methods | |||||
| ToKeyValuePairs IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Methods toKeyValuePairs ∷ KeyValue e kv ⇒ IndividualPoolStake → [kv] Source # | |||||
| NFData IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Methods rnf ∷ IndividualPoolStake → () # | |||||
| Generic IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Associated Types
Methods | |||||
| Show IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Methods showsPrec ∷ Int → IndividualPoolStake → ShowS # show ∷ IndividualPoolStake → String # showList ∷ [IndividualPoolStake] → ShowS # | |||||
| Eq IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr Methods | |||||
| NoThunks IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr | |||||
| type Rep IndividualPoolStake Source # | |||||
Defined in Cardano.Ledger.State.PoolDistr type Rep IndividualPoolStake = D1 ('MetaData "IndividualPoolStake" "Cardano.Ledger.State.PoolDistr" "cardano-ledger-core-1.19.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))))) | |||||
Snapshots of the stake distribution.
Note that ssStakeMark and ssStakeMarkPoolDistr are lazy on purpose since we only want to force the thunk after one stability window when we know that they are stable (so that we do not compute them if we do not have to). See more info in the Optimize TICKF ADR
Constructors
| SnapShots | |
Fields | |
Instances
| ToJSON SnapShots Source # | |||||
| DecCBOR SnapShots Source # | |||||
| DecShareCBOR SnapShots Source # | |||||
| EncCBOR SnapShots Source # | |||||
| ToKeyValuePairs SnapShots Source # | |||||
Defined in Cardano.Ledger.State.SnapShots Methods toKeyValuePairs ∷ KeyValue e kv ⇒ SnapShots → [kv] Source # | |||||
| Default SnapShots Source # | |||||
Defined in Cardano.Ledger.State.SnapShots | |||||
| NFData SnapShots Source # | |||||
Defined in Cardano.Ledger.State.SnapShots | |||||
| Generic SnapShots Source # | |||||
Defined in Cardano.Ledger.State.SnapShots Associated Types
| |||||
| Show SnapShots Source # | |||||
| Eq SnapShots Source # | |||||
| NoThunks SnapShots Source # | |||||
| type Share SnapShots Source # | |||||
| type Rep SnapShots Source # | |||||
Defined in Cardano.Ledger.State.SnapShots type Rep SnapShots = D1 ('MetaData "SnapShots" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "SnapShots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeMark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SnapShot) :*: S1 ('MetaSel ('Just "ssStakeMarkPoolDistr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PoolDistr)) :*: (S1 ('MetaSel ('Just "ssStakeSet") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: (S1 ('MetaSel ('Just "ssStakeGo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SnapShot) :*: S1 ('MetaSel ('Just "ssFee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))) | |||||
Type 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 | |
Fields
| |
Instances
| ToJSON Stake Source # | |||||
| DecShareCBOR Stake Source # | |||||
| EncCBOR Stake Source # | |||||
| NFData Stake Source # | |||||
Defined in Cardano.Ledger.State.SnapShots | |||||
| Generic Stake Source # | |||||
Defined in Cardano.Ledger.State.SnapShots Associated Types
| |||||
| Show Stake Source # | |||||
| Eq Stake Source # | |||||
| NoThunks Stake Source # | |||||
| type Share Stake Source # | |||||
| type Rep Stake Source # | |||||
Defined in Cardano.Ledger.State.SnapShots type Rep Stake = D1 ('MetaData "Stake" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "Stake" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VMap VB VP (Credential 'Staking) (CompactForm Coin))))) | |||||
sumAllStake ∷ Stake → Coin Source #
sumStakePerPool ∷ VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Coin Source #
Compute amount of stake each pool has. Any registered stake pool that has no stake will not be included in the resulting map
Snapshot of the stake distribution.
Constructors
| SnapShot | |
Fields
| |
Instances
| ToJSON SnapShot Source # | |||||
| DecShareCBOR SnapShot Source # | |||||
| EncCBOR SnapShot Source # | |||||
| ToKeyValuePairs SnapShot Source # | |||||
Defined in Cardano.Ledger.State.SnapShots Methods toKeyValuePairs ∷ KeyValue e kv ⇒ SnapShot → [kv] Source # | |||||
| NFData SnapShot Source # | |||||
Defined in Cardano.Ledger.State.SnapShots | |||||
| Generic SnapShot Source # | |||||
Defined in Cardano.Ledger.State.SnapShots Associated Types
| |||||
| Show SnapShot Source # | |||||
| Eq SnapShot Source # | |||||
| NoThunks SnapShot Source # | |||||
| type Share SnapShot Source # | |||||
| type Rep SnapShot Source # | |||||
Defined in Cardano.Ledger.State.SnapShots type Rep SnapShot = D1 ('MetaData "SnapShot" "Cardano.Ledger.State.SnapShots" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "SnapShot" 'PrefixI 'True) (S1 ('MetaSel ('Just "ssStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Stake) :*: (S1 ('MetaSel ('Just "ssDelegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (Credential 'Staking) (KeyHash 'StakePool))) :*: S1 ('MetaSel ('Just "ssPoolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) StakePoolParams))))) | |||||
poolStake ∷ KeyHash 'StakePool → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Stake Source #
Get stake of one pool
maxPool' ∷ NonNegativeInterval → NonZero Word16 → Coin → Rational → Rational → Coin Source #
Calculate maximal pool reward
calculatePoolStake ∷ (KeyHash 'StakePool → Bool) → VMap VB VB (Credential 'Staking) (KeyHash 'StakePool) → Stake → Map (KeyHash 'StakePool) Word64 Source #
Sum up the Coin (as CompactForm Coin = Word64) for each StakePool
ssStakeDistrL ∷ Lens' SnapShot (VMap VB VP (Credential 'Staking) (CompactForm Coin)) Source #
class (EraAccounts era, Eq (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 → Stake Source #
Using known stake credential registrations and delegations resolve the instant stake into a
Stake that will be used for SnapShot creation by snapShotFromInstantStake.
class CanGetInstantStake (t ∷ Type → Type) where Source #
Minimal complete definition
Nothing
Methods
instantStakeG ∷ SimpleGetter (t era) (InstantStake era) Source #
default instantStakeG ∷ CanSetInstantStake t ⇒ SimpleGetter (t era) (InstantStake era) Source #
class CanGetInstantStake t ⇒ CanSetInstantStake (t ∷ Type → Type) where Source #
Methods
instantStakeL ∷ Lens' (t era) (InstantStake era) Source #
snapShotFromInstantStake ∷ EraStake era ⇒ InstantStake era → DState era → PState era → SnapShot Source #
resolveActiveInstantStakeCredentials ∷ EraStake era ⇒ InstantStake era → Accounts era → Map (Credential 'Staking) (CompactForm Coin) 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 Source #
A stake pool.
Constructors
| StakePoolParams | |
Fields
| |
Bundled Patterns
| pattern PoolParams ∷ KeyHash 'StakePool → VRFVerKeyHash 'StakePoolVRF → Coin → Coin → UnitInterval → RewardAccount → Set (KeyHash 'Staking) → StrictSeq StakePoolRelay → StrictMaybe PoolMetadata → PoolParams | Deprecated: In favor of |
Instances
| FromJSON StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods parseJSON ∷ Value → Parser StakePoolParams Source # | |||||
| ToJSON StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods toJSON ∷ StakePoolParams → Value Source # toEncoding ∷ StakePoolParams → Encoding Source # toJSONList ∷ [StakePoolParams] → Value Source # | |||||
| DecCBOR StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| EncCBOR StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| DecCBORGroup StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| EncCBORGroup StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| Default StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| NFData StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods rnf ∷ StakePoolParams → () # | |||||
| Generic StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Associated Types
Methods from ∷ StakePoolParams → Rep StakePoolParams x # to ∷ Rep StakePoolParams x → StakePoolParams # | |||||
| Show StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods showsPrec ∷ Int → StakePoolParams → ShowS # show ∷ StakePoolParams → String # showList ∷ [StakePoolParams] → ShowS # | |||||
| Eq StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods (==) ∷ StakePoolParams → StakePoolParams → Bool # (/=) ∷ StakePoolParams → StakePoolParams → Bool # | |||||
| Ord StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods compare ∷ StakePoolParams → StakePoolParams → Ordering # (<) ∷ StakePoolParams → StakePoolParams → Bool # (<=) ∷ StakePoolParams → StakePoolParams → Bool # (>) ∷ StakePoolParams → StakePoolParams → Bool # (>=) ∷ StakePoolParams → StakePoolParams → Bool # | |||||
| NoThunks StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| type Rep StakePoolParams Source # | |||||
Defined in Cardano.Ledger.State.StakePool type Rep StakePoolParams = D1 ('MetaData "StakePoolParams" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "StakePoolParams" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sppId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'StakePool)) :*: S1 ('MetaSel ('Just "sppVrf") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VRFVerKeyHash 'StakePoolVRF))) :*: (S1 ('MetaSel ('Just "sppPledge") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "sppCost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) :*: ((S1 ('MetaSel ('Just "sppMargin") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Just "sppRewardAccount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardAccount)) :*: (S1 ('MetaSel ('Just "sppOwners") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (KeyHash 'Staking))) :*: (S1 ('MetaSel ('Just "sppRelays") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq StakePoolRelay)) :*: S1 ('MetaSel ('Just "sppMetadata") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe PoolMetadata))))))) | |||||
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
| FromJSON StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods parseJSON ∷ Value → Parser StakePoolState Source # | |||||
| ToJSON StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods toJSON ∷ StakePoolState → Value Source # toEncoding ∷ StakePoolState → Encoding Source # toJSONList ∷ [StakePoolState] → Value Source # | |||||
| DecCBOR StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| DecShareCBOR StakePoolState Source # | |||||
| EncCBOR StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| Default StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| NFData StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods rnf ∷ StakePoolState → () # | |||||
| Generic StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Associated Types
| |||||
| Show StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods showsPrec ∷ Int → StakePoolState → ShowS # show ∷ StakePoolState → String # showList ∷ [StakePoolState] → ShowS # | |||||
| Eq StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods (==) ∷ StakePoolState → StakePoolState → Bool # (/=) ∷ StakePoolState → StakePoolState → Bool # | |||||
| Ord StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods compare ∷ StakePoolState → StakePoolState → Ordering # (<) ∷ StakePoolState → StakePoolState → Bool # (<=) ∷ StakePoolState → StakePoolState → Bool # (>) ∷ StakePoolState → StakePoolState → Bool # (>=) ∷ StakePoolState → StakePoolState → Bool # | |||||
| NoThunks StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| type Share StakePoolState Source # | |||||
| type Rep StakePoolState Source # | |||||
Defined in Cardano.Ledger.State.StakePool type Rep StakePoolState = D1 ('MetaData "StakePoolState" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "StakePoolState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "spsVrf") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VRFVerKeyHash 'StakePoolVRF)) :*: S1 ('MetaSel ('Just "spsPledge") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "spsCost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "spsMargin") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnitInterval) :*: S1 ('MetaSel ('Just "spsRewardAccount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RewardAccount)))) :*: ((S1 ('MetaSel ('Just "spsOwners") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (KeyHash 'Staking))) :*: S1 ('MetaSel ('Just "spsRelays") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq StakePoolRelay))) :*: (S1 ('MetaSel ('Just "spsMetadata") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe PoolMetadata)) :*: (S1 ('MetaSel ('Just "spsDeposit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (CompactForm Coin)) :*: S1 ('MetaSel ('Just "spsDelegators") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Credential 'Staking)))))))) | |||||
stakePoolStateToStakePoolParams ∷ KeyHash 'StakePool → StakePoolState → StakePoolParams 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.
spsOwnersL ∷ Lens' StakePoolState (Set (KeyHash 'Staking)) Source #
mkStakePoolState ∷ CompactForm Coin → Set (Credential 'Staking) → StakePoolParams → 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.
data PoolMetadata Source #
Constructors
| PoolMetadata | |
Fields
| |
Instances
| FromJSON PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods parseJSON ∷ Value → Parser PoolMetadata Source # parseJSONList ∷ Value → Parser [PoolMetadata] Source # | |||||
| ToJSON PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods toJSON ∷ PoolMetadata → Value Source # toEncoding ∷ PoolMetadata → Encoding Source # toJSONList ∷ [PoolMetadata] → Value Source # toEncodingList ∷ [PoolMetadata] → Encoding Source # omitField ∷ PoolMetadata → Bool Source # | |||||
| DecCBOR PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| EncCBOR PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| NFData PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods rnf ∷ PoolMetadata → () # | |||||
| Generic PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Associated Types
| |||||
| Show PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods showsPrec ∷ Int → PoolMetadata → ShowS # show ∷ PoolMetadata → String # showList ∷ [PoolMetadata] → ShowS # | |||||
| Eq PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| Ord PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods compare ∷ PoolMetadata → PoolMetadata → Ordering # (<) ∷ PoolMetadata → PoolMetadata → Bool # (<=) ∷ PoolMetadata → PoolMetadata → Bool # (>) ∷ PoolMetadata → PoolMetadata → Bool # (>=) ∷ PoolMetadata → PoolMetadata → Bool # max ∷ PoolMetadata → PoolMetadata → PoolMetadata # min ∷ PoolMetadata → PoolMetadata → PoolMetadata # | |||||
| NoThunks PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| type Rep PoolMetadata Source # | |||||
Defined in Cardano.Ledger.State.StakePool type Rep PoolMetadata = D1 ('MetaData "PoolMetadata" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.19.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 ByteString))) | |||||
data StakePoolRelay Source #
Constructors
| SingleHostAddr !(StrictMaybe Port) !(StrictMaybe IPv4) !(StrictMaybe IPv6) | One or both of IPv4 & IPv6 |
| SingleHostName !(StrictMaybe Port) !DnsName | An |
| MultiHostName !DnsName | A |
Instances
| FromJSON StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods parseJSON ∷ Value → Parser StakePoolRelay Source # | |||||
| ToJSON StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods toJSON ∷ StakePoolRelay → Value Source # toEncoding ∷ StakePoolRelay → Encoding Source # toJSONList ∷ [StakePoolRelay] → Value Source # | |||||
| DecCBOR StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| EncCBOR StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods | |||||
| NFData StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods rnf ∷ StakePoolRelay → () # | |||||
| Generic StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Associated Types
| |||||
| Show StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods showsPrec ∷ Int → StakePoolRelay → ShowS # show ∷ StakePoolRelay → String # showList ∷ [StakePoolRelay] → ShowS # | |||||
| Eq StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods (==) ∷ StakePoolRelay → StakePoolRelay → Bool # (/=) ∷ StakePoolRelay → StakePoolRelay → Bool # | |||||
| Ord StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool Methods compare ∷ StakePoolRelay → StakePoolRelay → Ordering # (<) ∷ StakePoolRelay → StakePoolRelay → Bool # (<=) ∷ StakePoolRelay → StakePoolRelay → Bool # (>) ∷ StakePoolRelay → StakePoolRelay → Bool # (>=) ∷ StakePoolRelay → StakePoolRelay → Bool # | |||||
| NoThunks StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool | |||||
| type Rep StakePoolRelay Source # | |||||
Defined in Cardano.Ledger.State.StakePool type Rep StakePoolRelay = D1 ('MetaData "StakePoolRelay" "Cardano.Ledger.State.StakePool" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "SingleHostAddr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Port)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe IPv4)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe IPv6)))) :+: (C1 ('MetaCons "SingleHostName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe Port)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DnsName)) :+: C1 ('MetaCons "MultiHostName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DnsName)))) | |||||
data SizeOfPoolRelays Source #
The size of the sppRelays Set. Only used to compute size of encoded
StakePoolParams.
Constructors
| SizeOfPoolRelays |
Instances
| EncCBOR SizeOfPoolRelays Source # | |
Defined in Cardano.Ledger.State.StakePool Methods | |
data SizeOfPoolOwners Source #
The size of the sppOwners Set. Only used to compute size of encoded
StakePoolParams.
Constructors
| SizeOfPoolOwners |
Instances
| EncCBOR SizeOfPoolOwners Source # | |
Defined in Cardano.Ledger.State.StakePool Methods | |
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 #
Minimal complete definition
curPParamsGovStateL, prevPParamsGovStateL, futurePParamsGovStateL, obligationGovState
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
|
Instances
| ToJSON (PParams era) ⇒ ToJSON (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance Methods toJSON ∷ FuturePParams era → Value Source # toEncoding ∷ FuturePParams era → Encoding Source # toJSONList ∷ [FuturePParams era] → Value Source # toEncodingList ∷ [FuturePParams era] → Encoding Source # omitField ∷ FuturePParams era → Bool Source # | |||||
| (Typeable era, DecCBOR (PParams era)) ⇒ DecCBOR (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance | |||||
| EncCBOR (PParams era) ⇒ EncCBOR (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance Methods encCBOR ∷ FuturePParams era → Encoding Source # | |||||
| Default (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance Methods def ∷ FuturePParams era Source # | |||||
| NFData (PParams era) ⇒ NFData (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance Methods rnf ∷ FuturePParams era → () # | |||||
| Generic (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance Associated Types
Methods from ∷ FuturePParams era → Rep (FuturePParams era) x # to ∷ Rep (FuturePParams era) x → FuturePParams era # | |||||
| Show (PParams era) ⇒ Show (FuturePParams era) Source # | |||||
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 # | |||||
Defined in Cardano.Ledger.State.Governance Methods (==) ∷ FuturePParams era → FuturePParams era → Bool # (/=) ∷ FuturePParams era → FuturePParams era → Bool # | |||||
| NoThunks (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance | |||||
| type Rep (FuturePParams era) Source # | |||||
Defined in Cardano.Ledger.State.Governance type Rep (FuturePParams era) = D1 ('MetaData "FuturePParams" "Cardano.Ledger.State.Governance" "cardano-ledger-core-1.19.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)))))) | |||||
solidifyFuturePParams ∷ FuturePParams era → FuturePParams era Source #
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