cardano-ledger-shelley-1.15.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.Governance

Synopsis

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 #

Associated Types

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

Methods

emptyGovStateGovState era Source #

Construct empty governance state

getProposedPPUpdatesGovState era → Maybe (ProposedPPUpdates era) Source #

Returns Nothing for all eras starting with Conway, otherwise returns proposed pparams updates

curPParamsGovStateLLens' (GovState era) (PParams era) Source #

Lens for accessing current protocol parameters

prevPParamsGovStateLLens' (GovState era) (PParams era) Source #

Lens for accessing the previous protocol parameters

futurePParamsGovStateLLens' (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.

obligationGovStateGovState era → Obligations Source #

data ShelleyGovState era Source #

Constructors

ShelleyGovState 

Fields

Instances

Instances details
EraPParams era ⇒ ToJSON (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Generic (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Associated Types

type Rep (ShelleyGovState era) ∷ TypeType Source #

(Show (PParamsUpdate era), Show (PParams era)) ⇒ Show (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

(Era era, DecCBOR (PParamsUpdate era), DecCBOR (PParams era)) ⇒ FromCBOR (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

(Era era, EncCBOR (PParamsUpdate era), EncCBOR (PParams era)) ⇒ ToCBOR (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Methods

toCBORShelleyGovState era → Encoding Source #

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

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

(Era era, DecCBOR (PParamsUpdate era), DecCBOR (PParams era)) ⇒ DecCBOR (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

(Era era, DecCBOR (PParamsUpdate era), DecCBOR (PParams era)) ⇒ DecShareCBOR (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Associated Types

type Share (ShelleyGovState era) Source #

(Era era, EncCBOR (PParamsUpdate era), EncCBOR (PParams era)) ⇒ EncCBOR (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Methods

encCBORShelleyGovState era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (ShelleyGovState era) → Size Source #

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

EraPParams era ⇒ Default (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Methods

defShelleyGovState era Source #

(NFData (PParamsUpdate era), NFData (PParams era)) ⇒ NFData (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Methods

rnfShelleyGovState era → () Source #

(Eq (PParamsUpdate era), Eq (PParams era)) ⇒ Eq (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

(NoThunks (PParamsUpdate era), NoThunks (PParams era)) ⇒ NoThunks (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

type Rep (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

type Rep (ShelleyGovState era) = D1 ('MetaData "ShelleyGovState" "Cardano.Ledger.Shelley.Governance" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "ShelleyGovState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sgsCurProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ProposedPPUpdates era)) :*: S1 ('MetaSel ('Just "sgsFutureProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ProposedPPUpdates era))) :*: (S1 ('MetaSel ('Just "sgsCurPParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: (S1 ('MetaSel ('Just "sgsPrevPParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "sgsFuturePParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (FuturePParams era))))))
type Share (ShelleyGovState era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

type Share (ShelleyGovState era) = ()

data FuturePParams era Source #

Constructors

NoPParamsUpdate

This indicates that there is definitely not going to be an update to PParams expected at the next epoch boundary.

DefinitePParamsUpdate !(PParams era)

This case specifies the PParams that will be adopted at the next epoch boundary.

PotentialPParamsUpdate (Maybe (PParams era))

With this case there is no guarantee that these will be the new PParams, users should not rely on this value to be computed efficiently and should use nextEpochPParams instead. The field is lazy on purpose, since we truly need to compute this field only towards the end of the epoch, which is done by solidifyFuturePParams two stability windows before the end of the epoch.

Instances

Instances details
ToJSON (PParams era) ⇒ ToJSON (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Generic (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Associated Types

type Rep (FuturePParams era) ∷ TypeType Source #

Methods

fromFuturePParams era → Rep (FuturePParams era) x Source #

toRep (FuturePParams era) x → FuturePParams era Source #

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

Defined in Cardano.Ledger.Shelley.Governance

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

Defined in Cardano.Ledger.Shelley.Governance

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

Defined in Cardano.Ledger.Shelley.Governance

Methods

encCBORFuturePParams era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (FuturePParams era) → Size Source #

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

Default (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

Methods

defFuturePParams era Source #

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

Defined in Cardano.Ledger.Shelley.Governance

Methods

rnfFuturePParams era → () Source #

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

Defined in Cardano.Ledger.Shelley.Governance

Methods

(==)FuturePParams era → FuturePParams era → Bool Source #

(/=)FuturePParams era → FuturePParams era → Bool Source #

NoThunks (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

type Rep (FuturePParams era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Governance

type Rep (FuturePParams era) = D1 ('MetaData "FuturePParams" "Cardano.Ledger.Shelley.Governance" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "NoPParamsUpdate" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "DefinitePParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era))) :+: C1 ('MetaCons "PotentialPParamsUpdate" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (PParams era))))))

knownFuturePParamsFuturePParams 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

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

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