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 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 RatifyState era = RatifyState {
- rsEnactState ∷ !(EnactState era)
- rsEnacted ∷ !(Seq (GovActionState era))
- rsExpired ∷ !(Set (GovActionId (EraCrypto era)))
- rsDelayed ∷ !Bool
- data RatifyEnv era = RatifyEnv {
- reStakeDistr ∷ !(Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin))
- reStakePoolDistr ∷ !(PoolDistr (EraCrypto era))
- reDRepDistr ∷ !(Map (DRep (EraCrypto era)) (CompactForm Coin))
- reDRepState ∷ !(Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- reCurrentEpoch ∷ !EpochNo
- reCommitteeState ∷ !(CommitteeState era)
- reDelegatees ∷ !(Map (Credential 'Staking (EraCrypto era)) (DRep (EraCrypto era)))
- rePoolParams ∷ !(Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)))
- newtype RatifySignal era = RatifySignal {
- unRatifySignal ∷ StrictSeq (GovActionState 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)
- predictFuturePParams ∷ ConwayGovState era → ConwayGovState era
- data Committee era = Committee {
- committeeMembers ∷ !(Map (Credential 'ColdCommitteeRole (EraCrypto era)) EpochNo)
- committeeThreshold ∷ !UnitInterval
- committeeMembersL ∷ Lens' (Committee era) (Map (Credential 'ColdCommitteeRole (EraCrypto era)) EpochNo)
- committeeThresholdL ∷ Lens' (Committee era) UnitInterval
- 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 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
- newtype GovActionIx = GovActionIx {}
- data GovActionId c = GovActionId {
- gaidTxId ∷ !(TxId c)
- gaidGovActionIx ∷ !GovActionIx
- data GovActionPurpose
- class ToGovActionPurpose (p ∷ GovActionPurpose)
- isGovActionWithPurpose ∷ ∀ p era. ToGovActionPurpose p ⇒ GovAction era → Bool
- data DRepPulsingState era
- = DRPulsing !(DRepPulser era Identity (RatifyState era))
- | DRComplete !(PulsingSnapshot era) !(RatifyState era)
- data DRepPulser era (m ∷ Type → Type) ans where
- DRepPulser ∷ ∀ era ans m. (ans ~ RatifyState era, m ~ Identity, RunConwayRatify era) ⇒ {..} → DRepPulser era m ans
- govActionIdToText ∷ GovActionId c → Text
- data Voter c
- = CommitteeVoter !(Credential 'HotCommitteeRole c)
- | DRepVoter !(Credential 'DRepRole c)
- | StakePoolVoter !(KeyHash 'StakePool c)
- data Vote
- 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))
- foldlVotingProcedures ∷ (c → Voter (EraCrypto era) → GovActionId (EraCrypto era) → VotingProcedure era → c) → c → VotingProcedures era → c
- foldrVotingProcedures ∷ (Voter (EraCrypto era) → GovActionId (EraCrypto era) → VotingProcedure era → c → c) → c → VotingProcedures era → c
- data ProposalProcedure era = ProposalProcedure {
- pProcDeposit ∷ !Coin
- pProcReturnAddr ∷ !(RewardAccount (EraCrypto era))
- pProcGovAction ∷ !(GovAction era)
- pProcAnchor ∷ !(Anchor (EraCrypto era))
- data Anchor c = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash c AnchorData)
- newtype AnchorData = AnchorData ByteString
- indexedGovProps ∷ Seq (ProposalProcedure era) → Seq (GovActionIx, ProposalProcedure era)
- data Constitution era = Constitution {
- constitutionAnchor ∷ !(Anchor (EraCrypto era))
- constitutionScript ∷ !(StrictMaybe (ScriptHash (EraCrypto era)))
- class EraGov era ⇒ ConwayEraGov era where
- constitutionGovStateL ∷ Lens' (GovState era) (Constitution era)
- proposalsGovStateL ∷ Lens' (GovState era) (Proposals era)
- drepPulsingStateGovStateL ∷ Lens' (GovState era) (DRepPulsingState era)
- committeeGovStateL ∷ Lens' (GovState era) (StrictMaybe (Committee era))
- votingStakePoolThreshold ∷ ConwayEraPParams era ⇒ RatifyState era → GovAction era → StrictMaybe UnitInterval
- votingDRepThreshold ∷ ConwayEraPParams era ⇒ RatifyState era → GovAction era → StrictMaybe UnitInterval
- votingCommitteeThreshold ∷ ConwayEraPParams era ⇒ EpochNo → RatifyState era → CommitteeState era → GovAction era → StrictMaybe UnitInterval
- isStakePoolVotingAllowed ∷ ConwayEraPParams era ⇒ GovAction era → Bool
- isDRepVotingAllowed ∷ ConwayEraPParams era ⇒ GovAction era → Bool
- isCommitteeVotingAllowed ∷ ConwayEraPParams era ⇒ EpochNo → CommitteeState era → GovAction era → Bool
- reorderActions ∷ StrictSeq (GovActionState era) → StrictSeq (GovActionState era)
- actionPriority ∷ GovAction era → Int
- data Proposals era
- mkProposals ∷ (EraPParams era, MonadFail m) ⇒ GovRelation StrictMaybe era → OMap (GovActionId (EraCrypto era)) (GovActionState era) → m (Proposals era)
- unsafeMkProposals ∷ HasCallStack ⇒ GovRelation StrictMaybe era → OMap (GovActionId (EraCrypto era)) (GovActionState era) → Proposals era
- newtype GovPurposeId (p ∷ GovActionPurpose) era = GovPurposeId {
- unGovPurposeId ∷ GovActionId (EraCrypto era)
- data PRoot a = PRoot {
- prRoot ∷ !(StrictMaybe a)
- prChildren ∷ !(Set a)
- data PEdges a = PEdges {
- peParent ∷ !(StrictMaybe a)
- peChildren ∷ !(Set a)
- newtype PGraph a = PGraph {}
- pRootsL ∷ Lens' (Proposals era) (GovRelation PRoot era)
- pPropsL ∷ Lens' (Proposals era) (OMap (GovActionId (EraCrypto era)) (GovActionState era))
- prRootL ∷ Lens' (PRoot a) (StrictMaybe a)
- prChildrenL ∷ Lens' (PRoot a) (Set a)
- peChildrenL ∷ Lens' (PEdges a) (Set a)
- pGraphL ∷ Lens' (Proposals era) (GovRelation PGraph era)
- pGraphNodesL ∷ Lens' (PGraph a) (Map a (PEdges a))
- 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. (∀ f. Lens' (GovRelation f era) (f (GovPurposeId p era))) → StrictMaybe (GovPurposeId p era) → GovPurposeId p era → a) → a
- toPrevGovActionIds ∷ GovRelation PRoot era → GovRelation StrictMaybe era
- fromPrevGovActionIds ∷ GovRelation StrictMaybe era → GovRelation PRoot era
- grPParamUpdateL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'PParamUpdatePurpose era))
- grHardForkL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'HardForkPurpose era))
- grCommitteeL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'CommitteePurpose era))
- grConstitutionL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'ConstitutionPurpose era))
- proposalsActions ∷ Proposals era → StrictSeq (GovActionState era)
- proposalsDeposits ∷ Proposals era → Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin)
- proposalsAddAction ∷ ∀ era. (EraPParams era, HasCallStack) ⇒ GovActionState era → Proposals era → Maybe (Proposals era)
- proposalsRemoveWithDescendants ∷ EraPParams era ⇒ Set (GovActionId (EraCrypto era)) → Proposals era → (Proposals era, Map (GovActionId (EraCrypto era)) (GovActionState era))
- proposalsAddVote ∷ Voter (EraCrypto era) → Vote → GovActionId (EraCrypto era) → Proposals era → Proposals era
- proposalsIds ∷ Proposals era → StrictSeq (GovActionId (EraCrypto era))
- proposalsApplyEnactment ∷ ∀ era. EraPParams era ⇒ Seq (GovActionState era) → Set (GovActionId (EraCrypto era)) → Proposals era → (Proposals era, Map (GovActionId (EraCrypto era)) (GovActionState era), Map (GovActionId (EraCrypto era)) (GovActionState era), Map (GovActionId (EraCrypto era)) (GovActionState era))
- proposalsSize ∷ Proposals era → Int
- proposalsLookupId ∷ GovActionId (EraCrypto era) → Proposals era → Maybe (GovActionState era)
- proposalsActionsMap ∷ Proposals era → Map (GovActionId (EraCrypto era)) (GovActionState era)
- proposalsWithPurpose ∷ ∀ p era. ToGovActionPurpose p ⇒ (∀ f. Lens' (GovRelation f era) (f (GovPurposeId p era))) → Proposals era → Map (GovPurposeId p era) (GovActionState era)
- cgsProposalsL ∷ Lens' (ConwayGovState era) (Proposals era)
- cgsDRepPulsingStateL ∷ Lens' (ConwayGovState era) (DRepPulsingState era)
- cgsCurPParamsL ∷ Lens' (ConwayGovState era) (PParams era)
- cgsPrevPParamsL ∷ Lens' (ConwayGovState era) (PParams era)
- cgsFuturePParamsL ∷ Lens' (ConwayGovState era) (FuturePParams era)
- cgsCommitteeL ∷ Lens' (ConwayGovState era) (StrictMaybe (Committee era))
- cgsConstitutionL ∷ Lens' (ConwayGovState era) (Constitution era)
- ensCommitteeL ∷ Lens' (EnactState era) (StrictMaybe (Committee era))
- ensConstitutionL ∷ Lens' (EnactState era) (Constitution era)
- ensCurPParamsL ∷ Lens' (EnactState era) (PParams era)
- ensPrevPParamsL ∷ Lens' (EnactState era) (PParams era)
- ensWithdrawalsL ∷ Lens' (EnactState era) (Map (Credential 'Staking (EraCrypto era)) Coin)
- ensTreasuryL ∷ Lens' (EnactState era) Coin
- ensPrevGovActionIdsL ∷ Lens' (EnactState era) (GovRelation StrictMaybe era)
- ensPrevPParamUpdateL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'PParamUpdatePurpose era))
- ensPrevHardForkL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'HardForkPurpose era))
- ensPrevCommitteeL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'CommitteePurpose era))
- ensPrevConstitutionL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'ConstitutionPurpose era))
- ensProtVerL ∷ EraPParams era ⇒ Lens' (EnactState era) ProtVer
- rsEnactStateL ∷ Lens' (RatifyState era) (EnactState era)
- rsExpiredL ∷ Lens' (RatifyState era) (Set (GovActionId (EraCrypto era)))
- rsEnactedL ∷ Lens' (RatifyState era) (Seq (GovActionState era))
- rsDelayedL ∷ Lens' (RatifyState era) Bool
- constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe (ScriptHash (EraCrypto era)))
- constitutionAnchorL ∷ Lens' (Constitution era) (Anchor (EraCrypto era))
- gasIdL ∷ Lens' (GovActionState era) (GovActionId (EraCrypto era))
- gasDepositL ∷ Lens' (GovActionState era) Coin
- gasCommitteeVotesL ∷ Lens' (GovActionState era) (Map (Credential 'HotCommitteeRole (EraCrypto era)) Vote)
- gasDRepVotesL ∷ Lens' (GovActionState era) (Map (Credential 'DRepRole (EraCrypto era)) Vote)
- gasStakePoolVotesL ∷ Lens' (GovActionState era) (Map (KeyHash 'StakePool (EraCrypto era)) Vote)
- gasExpiresAfterL ∷ Lens' (GovActionState era) EpochNo
- gasActionL ∷ Lens' (GovActionState era) (GovAction era)
- gasReturnAddrL ∷ Lens' (GovActionState era) (RewardAccount (EraCrypto era))
- gasProposedInL ∷ Lens' (GovActionState era) EpochNo
- gasProposalProcedureL ∷ Lens' (GovActionState era) (ProposalProcedure era)
- gasDeposit ∷ GovActionState era → Coin
- gasAction ∷ GovActionState era → GovAction era
- gasReturnAddr ∷ GovActionState era → RewardAccount (EraCrypto era)
- pProcDepositL ∷ Lens' (ProposalProcedure era) Coin
- pProcGovActionL ∷ Lens' (ProposalProcedure era) (GovAction era)
- pProcReturnAddrL ∷ Lens' (ProposalProcedure era) (RewardAccount (EraCrypto era))
- pProcAnchorL ∷ Lens' (ProposalProcedure era) (Anchor (EraCrypto era))
- newEpochStateDRepPulsingStateL ∷ ConwayEraGov era ⇒ Lens' (NewEpochState era) (DRepPulsingState era)
- epochStateDRepPulsingStateL ∷ ConwayEraGov era ⇒ Lens' (EpochState era) (DRepPulsingState era)
- epochStateStakeDistrL ∷ Lens' (EpochState era) (VMap VB VP (Credential 'Staking (EraCrypto era)) (CompactForm Coin))
- epochStateIncrStakeDistrL ∷ Lens' (EpochState era) (Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin))
- epochStateRegDrepL ∷ Lens' (EpochState era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- epochStateUMapL ∷ Lens' (EpochState era) (UMap (EraCrypto era))
- pulseDRepPulsingState ∷ DRepPulsingState era → DRepPulsingState era
- completeDRepPulsingState ∷ DRepPulsingState era → DRepPulsingState era
- extractDRepPulsingState ∷ DRepPulsingState era → RatifyState era
- forceDRepPulsingState ∷ ConwayEraGov era ⇒ NewEpochState era → NewEpochState era
- finishDRepPulser ∷ ∀ era. DRepPulsingState era → (PulsingSnapshot era, RatifyState era)
- computeDRepDistr ∷ ∀ c. Map (Credential 'Staking c) (CompactForm Coin) → Map (Credential 'DRepRole c) (DRepState c) → Map (Credential 'Staking c) (CompactForm Coin) → PoolDistr c → Map (DRep c) (CompactForm Coin) → Map (Credential 'Staking c) (UMElem c) → (Map (DRep c) (CompactForm Coin), PoolDistr c)
- getRatifyState ∷ ConwayGovState era → RatifyState era
- conwayGovStateDRepDistrG ∷ SimpleGetter (ConwayGovState era) (Map (DRep (EraCrypto era)) (CompactForm Coin))
- psDRepDistrG ∷ SimpleGetter (DRepPulsingState era) (Map (DRep (EraCrypto era)) (CompactForm Coin))
- data PulsingSnapshot era = PulsingSnapshot {
- psProposals ∷ !(StrictSeq (GovActionState era))
- psDRepDistr ∷ !(Map (DRep (EraCrypto era)) (CompactForm Coin))
- psDRepState ∷ !(Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- psPoolDistr ∷ Map (KeyHash 'StakePool (EraCrypto era)) (CompactForm Coin)
- setCompleteDRepPulsingState ∷ GovState era ~ ConwayGovState era ⇒ PulsingSnapshot era → RatifyState era → EpochState era → EpochState era
- setFreshDRepPulsingState ∷ (GovState era ~ ConwayGovState era, Monad m, RunConwayRatify era, ConwayEraGov era) ⇒ EpochNo → PoolDistr (EraCrypto era) → EpochState era → ReaderT Globals m (EpochState era)
- psProposalsL ∷ Lens' (PulsingSnapshot era) (StrictSeq (GovActionState era))
- psDRepDistrL ∷ Lens' (PulsingSnapshot era) (Map (DRep (EraCrypto era)) (CompactForm Coin))
- psDRepStateL ∷ Lens' (PulsingSnapshot era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- psPoolDistrL ∷ Lens' (PulsingSnapshot era) (Map (KeyHash 'StakePool (EraCrypto era)) (CompactForm Coin))
- class (STS (ConwayRATIFY era), Signal (ConwayRATIFY era) ~ RatifySignal era, BaseM (ConwayRATIFY era) ~ Reader Globals, Environment (ConwayRATIFY era) ~ RatifyEnv era, State (ConwayRATIFY era) ~ RatifyState era, PredicateFailure (ConwayRATIFY era) ~ Void) ⇒ RunConwayRatify era where
- runConwayRatify ∷ Globals → RatifyEnv era → RatifyState era → RatifySignal era → RatifyState era
- govStatePrevGovActionIds ∷ ConwayEraGov era ⇒ GovState era → GovRelation StrictMaybe era
- mkEnactState ∷ ConwayEraGov era ⇒ GovState era → EnactState era
- ratifySignalL ∷ Lens' (RatifySignal era) (StrictSeq (GovActionState era))
- reStakeDistrL ∷ Lens' (RatifyEnv era) (Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin))
- reStakePoolDistrL ∷ Lens' (RatifyEnv era) (PoolDistr (EraCrypto era))
- reDRepDistrL ∷ Lens' (RatifyEnv era) (Map (DRep (EraCrypto era)) (CompactForm Coin))
- reDRepStateL ∷ Lens' (RatifyEnv era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)))
- reCurrentEpochL ∷ Lens' (RatifyEnv era) EpochNo
- reCommitteeStateL ∷ Lens' (RatifyEnv era) (CommitteeState era)
- pparamsUpdateThreshold ∷ ∀ era. ConwayEraPParams era ⇒ DRepVotingThresholds → PParamsUpdate era → UnitInterval
- data TreeMaybe a = TreeMaybe {
- unTreeMaybe ∷ Tree (StrictMaybe a)
- toGovRelationTree ∷ (Era era, HasCallStack) ⇒ Proposals era → GovRelation TreeMaybe era
- toGovRelationTreeEither ∷ Era era ⇒ Proposals era → Either String (GovRelation TreeMaybe era)
- showGovActionType ∷ GovAction era → String
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
data EnactState era Source #
EnactState | |
|
Instances
data RatifyState era Source #
RatifyState | |
|
Instances
RatifyEnv | |
|
Instances
newtype RatifySignal era Source #
Instances
data ConwayGovState era Source #
Conway governance state
ConwayGovState | |
|
Instances
predictFuturePParams ∷ ConwayGovState era → ConwayGovState era Source #
This function updates the thunk, which will contain new PParams once evaluated or Nothing when there was no update. At the same time if we already know the future of PParams, then it will act as an identity function.
Committee | |
|
Instances
committeeMembersL ∷ Lens' (Committee era) (Map (Credential 'ColdCommitteeRole (EraCrypto era)) EpochNo) Source #
committeeThresholdL ∷ Lens' (Committee era) UnitInterval Source #
Note that the previous governance action id is only optional for the very first governance action of the same purpose.
Instances
data GovActionState era Source #
GovActionState | |
|
Instances
newtype GovActionIx Source #
Instances
data GovActionId c Source #
GovActionId | |
|
Instances
data GovActionPurpose Source #
Instances
Generic GovActionPurpose Source # | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Show GovActionPurpose Source # | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Eq GovActionPurpose Source # | |
type Rep GovActionPurpose Source # | |
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))) |
class ToGovActionPurpose (p ∷ GovActionPurpose) Source #
toGovActionPurpose
isGovActionWithPurpose ∷ ∀ p era. ToGovActionPurpose p ⇒ GovAction era → Bool Source #
data DRepPulsingState era Source #
DRPulsing !(DRepPulser era Identity (RatifyState era)) | |
DRComplete !(PulsingSnapshot era) !(RatifyState era) |
Instances
data DRepPulser era (m ∷ Type → Type) ans where Source #
The type of a Pulser which uses computeDRepDistr
as its underlying
function. Note that we use two type equality (~) constraints to fix both
the monad m
and the ans
type, to the context where we will use the
type as a Pulser. The type DRepPulser must have m
and ans
as its last
two parameters so we can make a Pulsable instance. We will always use this
instantiation (DRepPulser era Identity (RatifyState era))
DRepPulser | |
|
Instances
govActionIdToText ∷ GovActionId c → Text Source #
CommitteeVoter !(Credential 'HotCommitteeRole c) | |
DRepVoter !(Credential 'DRepRole c) | |
StakePoolVoter !(KeyHash 'StakePool c) |
Instances
Instances
ToJSON Vote Source # | |
Bounded Vote Source # | |
Enum Vote Source # | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Generic Vote Source # | |
Show Vote Source # | |
DecCBOR Vote Source # | |
EncCBOR Vote Source # | |
NFData Vote Source # | |
Defined in Cardano.Ledger.Conway.Governance.Procedures | |
Eq Vote Source # | |
Ord Vote Source # | |
NoThunks Vote Source # | |
type Rep Vote Source # | |
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))) |
data VotingProcedure era Source #
VotingProcedure | |
|
Instances
newtype VotingProcedures era Source #
VotingProcedures | |
|
Instances
foldlVotingProcedures Source #
∷ (c → Voter (EraCrypto era) → GovActionId (EraCrypto era) → VotingProcedure era → c) | Accumulating function |
→ c | Initial accumulator |
→ VotingProcedures era | Procedures to fold over |
→ c |
foldrVotingProcedures Source #
∷ (Voter (EraCrypto era) → GovActionId (EraCrypto era) → VotingProcedure era → c → c) | Accumulating function |
→ c | Initial accumulator |
→ VotingProcedures era | Procedures to fold over |
→ c |
data ProposalProcedure era Source #
ProposalProcedure | |
|
Instances
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 # |
indexedGovProps ∷ Seq (ProposalProcedure era) → Seq (GovActionIx, ProposalProcedure era) Source #
Attaches indices to a sequence of proposal procedures. The indices grow from left to right.
data Constitution era Source #
Constitution | |
|
Instances
class EraGov era ⇒ ConwayEraGov era where Source #
constitutionGovStateL ∷ Lens' (GovState era) (Constitution era) Source #
proposalsGovStateL ∷ Lens' (GovState era) (Proposals era) Source #
drepPulsingStateGovStateL ∷ Lens' (GovState era) (DRepPulsingState era) Source #
committeeGovStateL ∷ Lens' (GovState era) (StrictMaybe (Committee era)) Source #
Instances
Crypto c ⇒ ConwayEraGov (ConwayEra c) Source # | |
Defined in Cardano.Ledger.Conway.Governance constitutionGovStateL ∷ Lens' (GovState (ConwayEra c)) (Constitution (ConwayEra c)) Source # proposalsGovStateL ∷ Lens' (GovState (ConwayEra c)) (Proposals (ConwayEra c)) Source # drepPulsingStateGovStateL ∷ Lens' (GovState (ConwayEra c)) (DRepPulsingState (ConwayEra c)) Source # committeeGovStateL ∷ Lens' (GovState (ConwayEra c)) (StrictMaybe (Committee (ConwayEra c))) Source # |
votingStakePoolThreshold ∷ ConwayEraPParams era ⇒ RatifyState era → GovAction era → StrictMaybe UnitInterval Source #
votingDRepThreshold ∷ ConwayEraPParams era ⇒ RatifyState era → GovAction era → StrictMaybe UnitInterval Source #
votingCommitteeThreshold ∷ ConwayEraPParams era ⇒ EpochNo → RatifyState era → CommitteeState era → GovAction era → StrictMaybe UnitInterval Source #
isStakePoolVotingAllowed ∷ ConwayEraPParams era ⇒ GovAction era → Bool Source #
isDRepVotingAllowed ∷ ConwayEraPParams era ⇒ GovAction era → Bool Source #
isCommitteeVotingAllowed ∷ ConwayEraPParams era ⇒ EpochNo → CommitteeState era → GovAction era → Bool Source #
reorderActions ∷ StrictSeq (GovActionState era) → StrictSeq (GovActionState era) Source #
actionPriority ∷ GovAction era → Int Source #
Self-contained representation of all 4 proposals trees. This forest
is made up of only action-ids for nodes - full GovActionState
s are
stored only once in the OMap
. All functions in this module prefixed
with the string proposals-
operate on this data-type keeping it
consistent.
NOTE: The correct way to think about this data-structure is similar
to 4 of the following, one for each GovActionPurpose
data Tree a = Node (StrictMaybe a) [Tree a]
but because this does not allow us to look-up a node's edges in
predictable time, we use a map from nodes to their edges (parent and
children) to capture the graph (
). We also need to always
know the roots of the 4 trees, and those we store in the PGraph
PRoot
NOTE: At the end of an epoch boundary, we expect
to be the same
as the pRoots
from the PrevGovActionIds
EnactState
Instances
mkProposals ∷ (EraPParams era, MonadFail m) ⇒ GovRelation StrictMaybe era → OMap (GovActionId (EraCrypto era)) (GovActionState era) → m (Proposals era) Source #
Reconstruct the
forest from an Proposals
of
OMap
s and the 4 roots (GovActionState
)PrevGovActionIds
unsafeMkProposals ∷ HasCallStack ⇒ GovRelation StrictMaybe era → OMap (GovActionId (EraCrypto era)) (GovActionState era) → Proposals era Source #
Reconstruct the
forest from an Proposals
of
OMap
s and the 4 roots (GovActionState
).
This function can fail and may return a malformed PrevGovActionIds
Proposals
if not given correct inputs.
WARNING: Should only be used for testing!
newtype GovPurposeId (p ∷ GovActionPurpose) era Source #
Instances
The root of a single Proposals
tree. prRoot
is always expected
to be equal to the respective PrevGovActionId
at the end of every
epoch boundary
PRoot | |
|
Instances
Generic (PRoot a) Source # | |
Show a ⇒ Show (PRoot a) Source # | |
Default (PRoot a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NFData a ⇒ NFData (PRoot a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
Eq a ⇒ Eq (PRoot a) Source # | |
Ord a ⇒ Ord (PRoot a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NoThunks a ⇒ NoThunks (PRoot a) Source # | |
type Rep (PRoot a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals type Rep (PRoot a) = D1 ('MetaData "PRoot" "Cardano.Ledger.Conway.Governance.Proposals" "cardano-ledger-conway-1.17.0.0-inplace" 'False) (C1 ('MetaCons "PRoot" 'PrefixI 'True) (S1 ('MetaSel ('Just "prRoot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe a)) :*: S1 ('MetaSel ('Just "prChildren") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set a)))) |
A non-root edges in a Proposals
tree. peParent
is expected to be
a SNothing
only at the begining when no governance actions has been
enacted yet.
PEdges | |
|
Instances
Generic (PEdges a) Source # | |
Show a ⇒ Show (PEdges a) Source # | |
Default (PEdges a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NFData a ⇒ NFData (PEdges a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
Eq a ⇒ Eq (PEdges a) Source # | |
Ord a ⇒ Ord (PEdges a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NoThunks a ⇒ NoThunks (PEdges a) Source # | |
type Rep (PEdges a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals type Rep (PEdges a) = D1 ('MetaData "PEdges" "Cardano.Ledger.Conway.Governance.Proposals" "cardano-ledger-conway-1.17.0.0-inplace" 'False) (C1 ('MetaCons "PEdges" 'PrefixI 'True) (S1 ('MetaSel ('Just "peParent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe a)) :*: S1 ('MetaSel ('Just "peChildren") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set a)))) |
A single proposal-tree. This map represents all the action-ids that form a tree.