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 (EraCrypto era)) (PParamsUpdate era))
- emptyPPPUpdates ∷ ProposedPPUpdates era
- data VotingProcedure era = VotingProcedure {
- vProcVote ∷ !Vote
- vProcAnchor ∷ !(StrictMaybe (Anchor (EraCrypto era)))
- newtype VotingProcedures era = VotingProcedures {
- unVotingProcedures ∷ Map (Voter (EraCrypto era)) (Map (GovActionId (EraCrypto era)) (VotingProcedure era))
- data ProposalProcedure era = ProposalProcedure {
- pProcDeposit ∷ !Coin
- pProcReturnAddr ∷ !(RewardAccount (EraCrypto era))
- pProcGovAction ∷ !(GovAction era)
- pProcAnchor ∷ !(Anchor (EraCrypto era))
- data Constitution era = Constitution {
- constitutionAnchor ∷ !(Anchor (EraCrypto era))
- constitutionScript ∷ !(StrictMaybe (ScriptHash (EraCrypto era)))
- constitutionAnchorL ∷ Lens' (Constitution era) (Anchor (EraCrypto era))
- constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe (ScriptHash (EraCrypto 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 ∷ Lens' (ConwayGovState era) (Proposals era)
- data RatifyState era = RatifyState {
- rsEnactState ∷ !(EnactState era)
- rsEnacted ∷ !(Seq (GovActionState era))
- rsExpired ∷ !(Set (GovActionId (EraCrypto era)))
- 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 (EraCrypto era)) Coin)
- ensPrevGovActionIds ∷ !(GovRelation StrictMaybe era)
- data Voter c
- = CommitteeVoter !(Credential 'HotCommitteeRole c)
- | DRepVoter !(Credential 'DRepRole c)
- | StakePoolVoter !(KeyHash 'StakePool c)
- data Vote
- data GovAction era
- = ParameterChange !(StrictMaybe (GovPurposeId 'PParamUpdatePurpose era)) !(PParamsUpdate era) !(StrictMaybe (ScriptHash (EraCrypto era)))
- | HardForkInitiation !(StrictMaybe (GovPurposeId 'HardForkPurpose era)) !ProtVer
- | TreasuryWithdrawals !(Map (RewardAccount (EraCrypto era)) Coin) !(StrictMaybe (ScriptHash (EraCrypto era)))
- | NoConfidence !(StrictMaybe (GovPurposeId 'CommitteePurpose era))
- | UpdateCommittee !(StrictMaybe (GovPurposeId 'CommitteePurpose era)) !(Set (Credential 'ColdCommitteeRole (EraCrypto era))) !(Map (Credential 'ColdCommitteeRole (EraCrypto era)) EpochNo) !UnitInterval
- | NewConstitution !(StrictMaybe (GovPurposeId 'ConstitutionPurpose era)) !(Constitution era)
- | InfoAction
- data GovActionId c = GovActionId {
- gaidTxId ∷ !(TxId c)
- gaidGovActionIx ∷ !GovActionIx
- newtype GovActionIx = GovActionIx {}
- data GovActionState era = GovActionState {
- gasId ∷ !(GovActionId (EraCrypto era))
- gasCommitteeVotes ∷ !(Map (Credential 'HotCommitteeRole (EraCrypto era)) Vote)
- gasDRepVotes ∷ !(Map (Credential 'DRepRole (EraCrypto era)) Vote)
- gasStakePoolVotes ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) 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 {
- unGovPurposeId ∷ GovActionId (EraCrypto era)
- govActionIdToText ∷ GovActionId c → Text
- data Anchor c = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash c AnchorData)
- newtype AnchorData = AnchorData ByteString
- hashAnchorData ∷ Crypto c ⇒ AnchorData → SafeHash c 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
Crypto c ⇒ EraGov (ShelleyEra c) | |
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 # |
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 (EraCrypto era)) (PParamsUpdate era)) |
Instances
Conway
Governance Procedures
data VotingProcedure era Source #
VotingProcedure | |
|
Instances
newtype VotingProcedures era Source #
VotingProcedures | |
|
Instances
data ProposalProcedure era Source #
ProposalProcedure | |
|
Instances
Constitution
data Constitution era Source #
Constitution | |
|
Instances
constitutionAnchorL ∷ Lens' (Constitution era) (Anchor (EraCrypto era)) Source #
constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe (ScriptHash (EraCrypto era))) Source #
Governance State
data ConwayGovState era Source #
Conway governance state
ConwayGovState | |
|
Instances
cgsProposalsL ∷ Lens' (ConwayGovState era) (Proposals era) Source #
data RatifyState era Source #
RatifyState | |
|
Instances
data EnactState era Source #
EnactState | |
|
Instances
CommitteeVoter !(Credential 'HotCommitteeRole c) | |
DRepVoter !(Credential 'DRepRole c) | |
StakePoolVoter !(KeyHash 'StakePool c) |
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.17.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 c Source #
GovActionId | |
|
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.17.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
govActionIdToText ∷ GovActionId c → Text Source #
Anchor
Anchor | |
|
Instances
Crypto c ⇒ FromJSON (Anchor c) | |
Crypto c ⇒ ToJSON (Anchor c) | |
Generic (Anchor c) | |
Show (Anchor c) | |
Crypto c ⇒ DecCBOR (Anchor c) | |
Crypto c ⇒ EncCBOR (Anchor c) | |
Crypto c ⇒ Default (Anchor c) | |
Defined in Cardano.Ledger.BaseTypes | |
Crypto c ⇒ NFData (Anchor c) | |
Defined in Cardano.Ledger.BaseTypes | |
Eq (Anchor c) | |
Ord (Anchor c) | |
NoThunks (Anchor c) | |
type Rep (Anchor c) | |
Defined in Cardano.Ledger.BaseTypes type Rep (Anchor c) = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.15.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 c AnchorData)))) |
newtype AnchorData Source #
Instances
SafeToHash AnchorData | |
Defined in Cardano.Ledger.BaseTypes originalBytes ∷ AnchorData → ByteString Source # originalBytesSize ∷ AnchorData → Int Source # makeHashWithExplicitProxys ∷ HashAlgorithm (HASH c) ⇒ Proxy c → Proxy index → AnchorData → SafeHash c index Source # | |
Eq AnchorData | |
Defined in Cardano.Ledger.BaseTypes (==) ∷ AnchorData → AnchorData → Bool Source # (/=) ∷ AnchorData → AnchorData → Bool Source # | |
HashWithCrypto AnchorData AnchorData | |
Defined in Cardano.Ledger.BaseTypes hashWithCrypto ∷ HashAlgorithm (HASH c) ⇒ Proxy c → AnchorData → SafeHash c AnchorData Source # |
hashAnchorData ∷ Crypto c ⇒ AnchorData → SafeHash c AnchorData Source #
Hash AnchorData