| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Api.Governance
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), 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
- emptyGovState ∷ EraGov era ⇒ GovState era
- curPParamsGovStateL ∷ EraGov era ⇒ Lens' (GovState era) (PParams era)
- prevPParamsGovStateL ∷ EraGov era ⇒ Lens' (GovState era) (PParams era)
- futurePParamsGovStateL ∷ EraGov era ⇒ Lens' (GovState era) (FuturePParams era)
- data ShelleyGovState era = ShelleyGovState {
- sgsCurProposals ∷ !(ProposedPPUpdates era)
- sgsFutureProposals ∷ !(ProposedPPUpdates era)
- sgsCurPParams ∷ !(PParams era)
- sgsPrevPParams ∷ !(PParams era)
- sgsFuturePParams ∷ !(FuturePParams era)
- newtype ProposedPPUpdates era = ProposedPPUpdates (Map (KeyHash 'Genesis) (PParamsUpdate era))
- emptyPPPUpdates ∷ ProposedPPUpdates era
- data VotingProcedure era = VotingProcedure {
- vProcVote ∷ !Vote
- vProcAnchor ∷ !(StrictMaybe Anchor)
- newtype VotingProcedures era = VotingProcedures {
- unVotingProcedures ∷ Map Voter (Map GovActionId (VotingProcedure era))
- data ProposalProcedure era = ProposalProcedure {
- pProcDeposit ∷ !Coin
- pProcReturnAddr ∷ !RewardAccount
- pProcGovAction ∷ !(GovAction era)
- pProcAnchor ∷ !Anchor
- data Constitution era = Constitution {}
- constitutionAnchorL ∷ ∀ era f. Functor f ⇒ (Anchor → f Anchor) → Constitution era → f (Constitution era)
- constitutionScriptL ∷ ∀ era f. Functor f ⇒ (StrictMaybe ScriptHash → f (StrictMaybe ScriptHash)) → Constitution era → f (Constitution era)
- data ConwayGovState era = ConwayGovState {
- cgsProposals ∷ !(Proposals era)
- cgsCommittee ∷ !(StrictMaybe (Committee era))
- cgsConstitution ∷ !(Constitution era)
- cgsCurPParams ∷ !(PParams era)
- cgsPrevPParams ∷ !(PParams era)
- cgsFuturePParams ∷ !(FuturePParams era)
- cgsDRepPulsingState ∷ !(DRepPulsingState era)
- cgsProposalsL ∷ ∀ era f. Functor f ⇒ (Proposals era → f (Proposals era)) → ConwayGovState era → f (ConwayGovState era)
- data RatifyState era = RatifyState {
- rsEnactState ∷ !(EnactState era)
- rsEnacted ∷ !(Seq (GovActionState era))
- rsExpired ∷ !(Set GovActionId)
- rsDelayed ∷ !Bool
- data EnactState era = EnactState {
- ensCommittee ∷ !(StrictMaybe (Committee era))
- ensConstitution ∷ !(Constitution era)
- ensCurPParams ∷ !(PParams era)
- ensPrevPParams ∷ !(PParams era)
- ensTreasury ∷ !Coin
- ensWithdrawals ∷ !(Map (Credential 'Staking) Coin)
- ensPrevGovActionIds ∷ !(GovRelation StrictMaybe)
- data Voter
- data Vote
- data GovAction era
- = ParameterChange !(StrictMaybe (GovPurposeId 'PParamUpdatePurpose)) !(PParamsUpdate era) !(StrictMaybe ScriptHash)
- | HardForkInitiation !(StrictMaybe (GovPurposeId 'HardForkPurpose)) !ProtVer
- | TreasuryWithdrawals !(Map RewardAccount Coin) !(StrictMaybe ScriptHash)
- | NoConfidence !(StrictMaybe (GovPurposeId 'CommitteePurpose))
- | UpdateCommittee !(StrictMaybe (GovPurposeId 'CommitteePurpose)) !(Set (Credential 'ColdCommitteeRole)) !(Map (Credential 'ColdCommitteeRole) EpochNo) !UnitInterval
- | NewConstitution !(StrictMaybe (GovPurposeId 'ConstitutionPurpose)) !(Constitution era)
- | InfoAction
- data GovActionId = GovActionId {}
- newtype GovActionIx = GovActionIx {}
- data GovActionState era = GovActionState {
- gasId ∷ !GovActionId
- gasCommitteeVotes ∷ !(Map (Credential 'HotCommitteeRole) Vote)
- gasDRepVotes ∷ !(Map (Credential 'DRepRole) Vote)
- gasStakePoolVotes ∷ !(Map (KeyHash 'StakePool) Vote)
- gasProposalProcedure ∷ !(ProposalProcedure era)
- gasProposedIn ∷ !EpochNo
- gasExpiresAfter ∷ !EpochNo
- data GovActionPurpose
- data GovRelation (f ∷ Type → Type) = GovRelation {
- grPParamUpdate ∷ !(f (GovPurposeId 'PParamUpdatePurpose))
- grHardFork ∷ !(f (GovPurposeId 'HardForkPurpose))
- grCommittee ∷ !(f (GovPurposeId 'CommitteePurpose))
- grConstitution ∷ !(f (GovPurposeId 'ConstitutionPurpose))
- hoistGovRelation ∷ (∀ a. f a → g a) → GovRelation f → GovRelation g
- withGovActionParent ∷ GovActionState era → a → (∀ (p ∷ GovActionPurpose). (∀ (f1 ∷ Type → Type) (f2 ∷ Type → Type). Functor f2 ⇒ (f1 (GovPurposeId p) → f2 (f1 (GovPurposeId p))) → GovRelation f1 → f2 (GovRelation f1)) → StrictMaybe (GovPurposeId p) → GovPurposeId p → a) → a
- newtype GovPurposeId (p ∷ GovActionPurpose) = GovPurposeId {}
- govActionIdToText ∷ GovActionId → Text
- data Anchor = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash AnchorData)
- newtype AnchorData = AnchorData ByteString
- hashAnchorData ∷ AnchorData → SafeHash AnchorData
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), 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 Source #
Minimal complete definition
curPParamsGovStateL, prevPParamsGovStateL, futurePParamsGovStateL, obligationGovState
emptyGovState ∷ EraGov era ⇒ GovState era Source #
Construct empty governance state
curPParamsGovStateL ∷ EraGov era ⇒ Lens' (GovState era) (PParams era) Source #
Lens for accessing current protocol parameters
prevPParamsGovStateL ∷ EraGov era ⇒ Lens' (GovState era) (PParams era) Source #
Lens for accessing the previous protocol parameters
futurePParamsGovStateL ∷ EraGov era ⇒ 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.
Shelley
data ShelleyGovState era Source #
Constructors
| ShelleyGovState | |
Fields
| |
Instances
newtype ProposedPPUpdates era Source #
Update operation for protocol parameters structure PParams
Constructors
| ProposedPPUpdates (Map (KeyHash 'Genesis) (PParamsUpdate era)) |
Instances
Conway
Governance Procedures
data VotingProcedure era Source #
Constructors
| VotingProcedure | |
Fields
| |
Instances
newtype VotingProcedures era Source #
Constructors
| VotingProcedures | |
Fields
| |
Instances
data ProposalProcedure era Source #
Constructors
| ProposalProcedure | |
Fields
| |
Instances
Constitution
data Constitution era Source #
Constructors
| Constitution | |
Fields | |
Instances
constitutionAnchorL ∷ ∀ era f. Functor f ⇒ (Anchor → f Anchor) → Constitution era → f (Constitution era) Source #
constitutionScriptL ∷ ∀ era f. Functor f ⇒ (StrictMaybe ScriptHash → f (StrictMaybe ScriptHash)) → Constitution era → f (Constitution era) Source #
Governance State
data ConwayGovState era Source #
Conway governance state
Constructors
| ConwayGovState | |
Fields
| |
Instances
cgsProposalsL ∷ ∀ era f. Functor f ⇒ (Proposals era → f (Proposals era)) → ConwayGovState era → f (ConwayGovState era) Source #
data RatifyState era Source #
RatifyState stores information about what will happen to the active
governance actions at the next epoch boundary.
Constructors
| RatifyState | |
Fields
| |
Instances
data EnactState era Source #
Constructors
| EnactState | |
Fields
| |
Instances
Constructors
| CommitteeVoter !(Credential 'HotCommitteeRole) | |
| DRepVoter !(Credential 'DRepRole) | |
| StakePoolVoter !(KeyHash 'StakePool) |
Instances
Instances
| ToJSON Vote | |
| Bounded Vote | |
| Enum Vote | |
| Generic Vote | |
| Show Vote | |
| DecCBOR Vote | |
| EncCBOR Vote | |
| NFData Vote | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
| Eq Vote | |
| Ord Vote | |
| NoThunks Vote | |
| type Rep Vote | |
Defined in Cardano.Ledger.Conway.Governance.Procedures type Rep Vote = D1 ('MetaData "Vote" "Cardano.Ledger.Conway.Governance.Procedures" "cardano-ledger-conway-1.21.0.0-inplace" 'False) (C1 ('MetaCons "VoteNo" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "VoteYes" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "Abstain" 'PrefixI 'False) (U1 ∷ Type → Type))) | |
Governance Action
Note that the previous governance action id is only optional for the very first governance action of the same purpose.
Constructors
| ParameterChange | |
Fields
| |
| HardForkInitiation | |
Fields
| |
| TreasuryWithdrawals | |
Fields
| |
| NoConfidence | |
Fields
| |
| UpdateCommittee | |
Fields
| |
| NewConstitution | |
Fields
| |
| InfoAction | |
Instances
data GovActionId Source #
Constructors
| GovActionId | |
Fields | |
Instances
newtype GovActionIx Source #
Constructors
| GovActionIx | |
Fields | |
Instances
data GovActionState era Source #
Constructors
| GovActionState | |
Fields
| |
Instances
data GovActionPurpose Source #
Instances
data GovRelation (f ∷ Type → Type) Source #
Abstract data type for representing relationship of governance action with the same purpose
Constructors
| GovRelation | |
Fields
| |
Instances
hoistGovRelation ∷ (∀ a. f a → g a) → GovRelation f → GovRelation g Source #
Arguments
| ∷ GovActionState era | |
| → a | The result to be used for governance actions that can't have a parent |
| → (∀ (p ∷ GovActionPurpose). (∀ (f1 ∷ Type → Type) (f2 ∷ Type → Type). Functor f2 ⇒ (f1 (GovPurposeId p) → f2 (f1 (GovPurposeId p))) → GovRelation f1 → f2 (GovRelation f1)) → StrictMaybe (GovPurposeId p) → GovPurposeId p → a) | Function that will be applied to a lens and a parent |
| → a |
Apply a function to a GovAction that can have a parent.
newtype GovPurposeId (p ∷ GovActionPurpose) Source #
Constructors
| GovPurposeId | |
Fields | |
Instances
Anchor
Constructors
| Anchor | |
Fields
| |
Instances
| FromJSON Anchor | |
| ToJSON Anchor | |
| Generic Anchor | |
| Show Anchor | |
| DecCBOR Anchor | |
| EncCBOR Anchor | |
| ToKeyValuePairs Anchor | |
Defined in Cardano.Ledger.BaseTypes Methods toKeyValuePairs ∷ KeyValue e kv ⇒ Anchor → [kv] Source # | |
| Default Anchor | |
Defined in Cardano.Ledger.BaseTypes | |
| NFData Anchor | |
Defined in Cardano.Ledger.BaseTypes | |
| Eq Anchor | |
| Ord Anchor | |
| NoThunks Anchor | |
| type Rep Anchor | |
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)))) | |
newtype AnchorData Source #
Constructors
| AnchorData ByteString |
Instances
| SafeToHash AnchorData | |
Defined in Cardano.Ledger.BaseTypes Methods originalBytes ∷ AnchorData → ByteString Source # originalBytesSize ∷ AnchorData → Int Source # makeHashWithExplicitProxys ∷ Proxy i → AnchorData → SafeHash i Source # | |
| Eq AnchorData | |
Defined in Cardano.Ledger.BaseTypes | |
| HashAnnotated AnchorData AnchorData | |
Defined in Cardano.Ledger.BaseTypes Methods | |