Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (EraPParams era, Eq (GovState era), Show (GovState era), NoThunks (GovState era), NFData (GovState era), EncCBOR (GovState era), DecCBOR (GovState era), DecShareCBOR (GovState era), 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
- getProposedPPUpdates ∷ GovState era → Maybe (ProposedPPUpdates era)
- curPParamsGovStateL ∷ Lens' (GovState era) (PParams era)
- prevPParamsGovStateL ∷ Lens' (GovState era) (PParams era)
- futurePParamsGovStateL ∷ Lens' (GovState era) (FuturePParams era)
- obligationGovState ∷ GovState era → Obligations
- data ShelleyGovState era = ShelleyGovState {
- sgsCurProposals ∷ !(ProposedPPUpdates era)
- sgsFutureProposals ∷ !(ProposedPPUpdates era)
- sgsCurPParams ∷ !(PParams era)
- sgsPrevPParams ∷ !(PParams era)
- sgsFuturePParams ∷ !(FuturePParams era)
- emptyShelleyGovState ∷ EraPParams era ⇒ ShelleyGovState era
- data FuturePParams era
- = NoPParamsUpdate
- | DefinitePParamsUpdate !(PParams era)
- | PotentialPParamsUpdate (Maybe (PParams era))
- solidifyFuturePParams ∷ FuturePParams era → FuturePParams era
- knownFuturePParams ∷ FuturePParams era → Maybe (PParams era)
- nextEpochPParams ∷ EraGov era ⇒ GovState era → PParams era
- nextEpochUpdatedPParams ∷ EraGov era ⇒ GovState era → StrictMaybe (PParams era)
- proposalsL ∷ Lens' (ShelleyGovState era) (ProposedPPUpdates era)
- futureProposalsL ∷ Lens' (ShelleyGovState era) (ProposedPPUpdates era)
- curPParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (PParams era)
- prevPParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (PParams era)
- futurePParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (FuturePParams era)
- proposals ∷ ShelleyGovState era → ProposedPPUpdates era
- futureProposals ∷ ShelleyGovState era → ProposedPPUpdates era
- sgovPp ∷ ShelleyGovState era → PParams era
- sgovPrevPp ∷ ShelleyGovState era → PParams era
Documentation
class (EraPParams era, Eq (GovState era), Show (GovState era), NoThunks (GovState era), NFData (GovState era), EncCBOR (GovState era), DecCBOR (GovState era), DecShareCBOR (GovState era), ToCBOR (GovState era), FromCBOR (GovState era), Default (GovState era), ToJSON (GovState era)) ⇒ EraGov era where Source #
emptyGovState ∷ GovState era Source #
Construct empty governance state
getProposedPPUpdates ∷ GovState era → Maybe (ProposedPPUpdates era) Source #
Returns Nothing
for all eras starting with Conway, otherwise returns proposed
pparams updates
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 #
Instances
Crypto c ⇒ EraGov (ShelleyEra c) Source # | |
Defined in Cardano.Ledger.Shelley.Governance type GovState (ShelleyEra c) = (r ∷ Type) Source # emptyGovState ∷ GovState (ShelleyEra c) Source # getProposedPPUpdates ∷ GovState (ShelleyEra c) → Maybe (ProposedPPUpdates (ShelleyEra c)) Source # curPParamsGovStateL ∷ Lens' (GovState (ShelleyEra c)) (PParams (ShelleyEra c)) Source # prevPParamsGovStateL ∷ Lens' (GovState (ShelleyEra c)) (PParams (ShelleyEra c)) Source # futurePParamsGovStateL ∷ Lens' (GovState (ShelleyEra c)) (FuturePParams (ShelleyEra c)) Source # obligationGovState ∷ GovState (ShelleyEra c) → Obligations Source # |
data ShelleyGovState era Source #
ShelleyGovState | |
|
Instances
emptyShelleyGovState ∷ EraPParams era ⇒ ShelleyGovState era Source #
data FuturePParams era Source #
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
solidifyFuturePParams ∷ FuturePParams era → FuturePParams era Source #
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
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.
proposalsL ∷ Lens' (ShelleyGovState era) (ProposedPPUpdates era) Source #
futureProposalsL ∷ Lens' (ShelleyGovState era) (ProposedPPUpdates era) Source #
curPParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (PParams era) Source #
prevPParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (PParams era) Source #
futurePParamsShelleyGovStateL ∷ Lens' (ShelleyGovState era) (FuturePParams era) Source #
Deprecations
proposals ∷ ShelleyGovState era → ProposedPPUpdates era Source #
Deprecated: In favor of sgsCurProposals
futureProposals ∷ ShelleyGovState era → ProposedPPUpdates era Source #
Deprecated: In favor of sgsFutureProposals
sgovPp ∷ ShelleyGovState era → PParams era Source #
Deprecated: In favor of sgsCurPParams
sgovPrevPp ∷ ShelleyGovState era → PParams era Source #
Deprecated: In favor of sgsPrevPParams