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
- emptyGovState ∷ EraGov era ⇒ GovState era
- getProposedPPUpdates ∷ EraGov era ⇒ GovState era → Maybe (ProposedPPUpdates 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 ∷ Lens' (Constitution era) Anchor
- constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe ScriptHash)
- 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 ∷ Lens' (ConwayGovState era) (Proposals 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 era)
- data Voter
- data Vote
- data GovAction era
- = ParameterChange !(StrictMaybe (GovPurposeId 'PParamUpdatePurpose era)) !(PParamsUpdate era) !(StrictMaybe ScriptHash)
- | HardForkInitiation !(StrictMaybe (GovPurposeId 'HardForkPurpose era)) !ProtVer
- | TreasuryWithdrawals !(Map RewardAccount Coin) !(StrictMaybe ScriptHash)
- | NoConfidence !(StrictMaybe (GovPurposeId 'CommitteePurpose era))
- | UpdateCommittee !(StrictMaybe (GovPurposeId 'CommitteePurpose era)) !(Set (Credential 'ColdCommitteeRole)) !(Map (Credential 'ColdCommitteeRole) EpochNo) !UnitInterval
- | NewConstitution !(StrictMaybe (GovPurposeId 'ConstitutionPurpose era)) !(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) era = GovRelation {
- grPParamUpdate ∷ !(f (GovPurposeId 'PParamUpdatePurpose era))
- grHardFork ∷ !(f (GovPurposeId 'HardForkPurpose era))
- grCommittee ∷ !(f (GovPurposeId 'CommitteePurpose era))
- grConstitution ∷ !(f (GovPurposeId 'ConstitutionPurpose era))
- hoistGovRelation ∷ (∀ a. f a → g a) → GovRelation f era → GovRelation g era
- withGovActionParent ∷ GovActionState era → a → (∀ (p ∷ GovActionPurpose). (∀ (f ∷ Type → Type). Lens' (GovRelation f era) (f (GovPurposeId p era))) → StrictMaybe (GovPurposeId p era) → GovPurposeId p era → a) → a
- newtype GovPurposeId (p ∷ GovActionPurpose) era = 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), ToCBOR (GovState era), FromCBOR (GovState era), Default (GovState era), ToJSON (GovState era)) ⇒ EraGov era Source #
Instances
emptyGovState ∷ EraGov era ⇒ GovState era Source #
Construct empty governance state
getProposedPPUpdates ∷ EraGov era ⇒ GovState era → Maybe (ProposedPPUpdates era) Source #
Returns Nothing
for all eras starting with Conway, otherwise returns proposed
pparams updates
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 #
ShelleyGovState | |
|
Instances
newtype ProposedPPUpdates era Source #
Update operation for protocol parameters structure PParams
ProposedPPUpdates (Map (KeyHash 'Genesis) (PParamsUpdate era)) |
Instances
Conway
Governance Procedures
data VotingProcedure era Source #
Instances
newtype VotingProcedures era Source #
Instances
data ProposalProcedure era Source #
ProposalProcedure | |
|
Instances
Constitution
data Constitution era Source #
Instances
constitutionAnchorL ∷ Lens' (Constitution era) Anchor Source #
constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe ScriptHash) Source #
Governance State
data ConwayGovState era Source #
Conway governance state
ConwayGovState | |
|
Instances
cgsProposalsL ∷ Lens' (ConwayGovState era) (Proposals era) Source #
data RatifyState era Source #
RatifyState
stores information about what will happen to the active
governance actions at the next epoch boundary.
RatifyState | |
|
Instances
data EnactState era Source #
EnactState | |
|
Instances
CommitteeVoter !(Credential 'HotCommitteeRole) | |
DRepVoter !(Credential 'DRepRole) | |
StakePoolVoter !(KeyHash 'StakePool) |
Instances
Instances
ToJSON Vote | |
Bounded Vote | |
Enum Vote | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
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.19.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.
Instances
data GovActionId Source #
Instances
newtype GovActionIx Source #
Instances
data GovActionState era Source #
GovActionState | |
|
Instances
data GovActionPurpose Source #
Instances
Generic GovActionPurpose | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Show GovActionPurpose | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Eq GovActionPurpose | |
type Rep GovActionPurpose | |
Defined in Cardano.Ledger.Conway.Governance.Procedures type Rep GovActionPurpose = D1 ('MetaData "GovActionPurpose" "Cardano.Ledger.Conway.Governance.Procedures" "cardano-ledger-conway-1.19.0.0-inplace" 'False) ((C1 ('MetaCons "PParamUpdatePurpose" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "HardForkPurpose" 'PrefixI 'False) (U1 ∷ Type → Type)) :+: (C1 ('MetaCons "CommitteePurpose" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "ConstitutionPurpose" 'PrefixI 'False) (U1 ∷ Type → Type))) |
data GovRelation (f ∷ Type → Type) era Source #
Abstract data type for representing relationship of governance action with the same purpose
GovRelation | |
|
Instances
hoistGovRelation ∷ (∀ a. f a → g a) → GovRelation f era → GovRelation g era Source #
∷ GovActionState era | |
→ a | The result to be used for governance actions that can't have a parent |
→ (∀ (p ∷ GovActionPurpose). (∀ (f ∷ Type → Type). Lens' (GovRelation f era) (f (GovPurposeId p era))) → StrictMaybe (GovPurposeId p era) → GovPurposeId p era → 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) era Source #
Instances
Anchor
Anchor | |
|
Instances
FromJSON Anchor | |
ToJSON Anchor | |
Generic Anchor | |
Show Anchor | |
DecCBOR Anchor | |
EncCBOR Anchor | |
Default Anchor | |
Defined in Cardano.Ledger.BaseTypes | |
NFData Anchor | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Anchor | |
Ord Anchor | |
Defined in Cardano.Ledger.BaseTypes | |
NoThunks Anchor | |
type Rep Anchor | |
Defined in Cardano.Ledger.BaseTypes type Rep Anchor = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.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 #
Instances
SafeToHash AnchorData | |
Defined in Cardano.Ledger.BaseTypes | |
Eq AnchorData | |
Defined in Cardano.Ledger.BaseTypes (==) ∷ AnchorData → AnchorData → Bool Source # (/=) ∷ AnchorData → AnchorData → Bool Source # | |
HashAnnotated AnchorData AnchorData | |
Defined in Cardano.Ledger.BaseTypes |