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, EraPParams era) ⇒ 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)
- data DefaultVote
- defaultStakePoolVote ∷ KeyHash 'StakePool c → Map (KeyHash 'StakePool c) (PoolParams c) → Map (Credential 'Staking c) (DRep c) → DefaultVote
- 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
stores information about what will happen to the active
governance actions at the next epoch boundary.
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.18.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.18.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.16.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, EraPParams era) ⇒ 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.18.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.18.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.
Instances
Generic (PGraph a) Source # | |
Show a ⇒ Show (PGraph a) Source # | |
Default (PGraph a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NFData a ⇒ NFData (PGraph a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
Eq a ⇒ Eq (PGraph a) Source # | |
Ord a ⇒ Ord (PGraph a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals | |
NoThunks a ⇒ NoThunks (PGraph a) Source # | |
type Rep (PGraph a) Source # | |
Defined in Cardano.Ledger.Conway.Governance.Proposals |
pPropsL ∷ Lens' (Proposals era) (OMap (GovActionId (EraCrypto era)) (GovActionState era)) Source #
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. (∀ f. 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.
toPrevGovActionIds ∷ GovRelation PRoot era → GovRelation StrictMaybe era Source #
fromPrevGovActionIds ∷ GovRelation StrictMaybe era → GovRelation PRoot era Source #
grPParamUpdateL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'PParamUpdatePurpose era)) Source #
grHardForkL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'HardForkPurpose era)) Source #
grCommitteeL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'CommitteePurpose era)) Source #
grConstitutionL ∷ Lens' (GovRelation f era) (f (GovPurposeId 'ConstitutionPurpose era)) Source #
proposalsActions ∷ Proposals era → StrictSeq (GovActionState era) Source #
Get the sequence of GovActionState
s
proposalsDeposits ∷ Proposals era → Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin) Source #
Get a mapping from the reward-account staking credentials to deposits of all proposals.
proposalsAddAction ∷ ∀ era. (EraPParams era, HasCallStack) ⇒ GovActionState era → Proposals era → Maybe (Proposals era) Source #
Add a single
to the GovActionState
forest.
The tree to which it is added is picked according to its
Proposals
. Returns GovActionPurpose
Nothing
when the operation cannot
succeed.
proposalsRemoveWithDescendants ∷ EraPParams era ⇒ Set (GovActionId (EraCrypto era)) → Proposals era → (Proposals era, Map (GovActionId (EraCrypto era)) (GovActionState era)) Source #
Remove the set of given action-ids with their descendants from the
forest. Cannot be used for removing enacted GovActionIds (i.e. roots)Proposals
proposalsAddVote ∷ Voter (EraCrypto era) → Vote → GovActionId (EraCrypto era) → Proposals era → Proposals era Source #
Add a vote to an existing GovActionState
. This is a no-op if the
provided GovActionId
does not already exist
proposalsIds ∷ Proposals era → StrictSeq (GovActionId (EraCrypto era)) Source #
Get the sequence of GovActionId
s
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)) Source #
For use in the
rule. Apply the result of
EPOCH
to the extractDRepPulsingState
forest, so that:
i. all the expired action-ids and their descendants are removed,
and
ii. the sequence of enacted action-ids is promoted to the root,
removing competing/sibling action-ids and their descendants at each
stepProposals
proposalsSize ∷ Proposals era → Int Source #
proposalsLookupId ∷ GovActionId (EraCrypto era) → Proposals era → Maybe (GovActionState era) Source #
proposalsActionsMap ∷ Proposals era → Map (GovActionId (EraCrypto era)) (GovActionState era) Source #
Get the unordered map of GovActionId
s and GovActionState
s
proposalsWithPurpose ∷ ∀ p era. ToGovActionPurpose p ⇒ (∀ f. Lens' (GovRelation f era) (f (GovPurposeId p era))) → Proposals era → Map (GovPurposeId p era) (GovActionState era) Source #
cgsProposalsL ∷ Lens' (ConwayGovState era) (Proposals era) Source #
cgsDRepPulsingStateL ∷ Lens' (ConwayGovState era) (DRepPulsingState era) Source #
cgsCurPParamsL ∷ Lens' (ConwayGovState era) (PParams era) Source #
cgsPrevPParamsL ∷ Lens' (ConwayGovState era) (PParams era) Source #
cgsFuturePParamsL ∷ Lens' (ConwayGovState era) (FuturePParams era) Source #
cgsCommitteeL ∷ Lens' (ConwayGovState era) (StrictMaybe (Committee era)) Source #
cgsConstitutionL ∷ Lens' (ConwayGovState era) (Constitution era) Source #
ensCommitteeL ∷ Lens' (EnactState era) (StrictMaybe (Committee era)) Source #
ensConstitutionL ∷ Lens' (EnactState era) (Constitution era) Source #
ensCurPParamsL ∷ Lens' (EnactState era) (PParams era) Source #
ensPrevPParamsL ∷ Lens' (EnactState era) (PParams era) Source #
ensWithdrawalsL ∷ Lens' (EnactState era) (Map (Credential 'Staking (EraCrypto era)) Coin) Source #
ensTreasuryL ∷ Lens' (EnactState era) Coin Source #
ensPrevGovActionIdsL ∷ Lens' (EnactState era) (GovRelation StrictMaybe era) Source #
ensPrevPParamUpdateL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'PParamUpdatePurpose era)) Source #
ensPrevHardForkL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'HardForkPurpose era)) Source #
ensPrevCommitteeL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'CommitteePurpose era)) Source #
ensPrevConstitutionL ∷ Lens' (EnactState era) (StrictMaybe (GovPurposeId 'ConstitutionPurpose era)) Source #
ensProtVerL ∷ EraPParams era ⇒ Lens' (EnactState era) ProtVer Source #
rsEnactStateL ∷ Lens' (RatifyState era) (EnactState era) Source #
rsExpiredL ∷ Lens' (RatifyState era) (Set (GovActionId (EraCrypto era))) Source #
rsEnactedL ∷ Lens' (RatifyState era) (Seq (GovActionState era)) Source #
rsDelayedL ∷ Lens' (RatifyState era) Bool Source #
constitutionScriptL ∷ Lens' (Constitution era) (StrictMaybe (ScriptHash (EraCrypto era))) Source #
constitutionAnchorL ∷ Lens' (Constitution era) (Anchor (EraCrypto era)) Source #
gasIdL ∷ Lens' (GovActionState era) (GovActionId (EraCrypto era)) Source #
gasDepositL ∷ Lens' (GovActionState era) Coin Source #
gasCommitteeVotesL ∷ Lens' (GovActionState era) (Map (Credential 'HotCommitteeRole (EraCrypto era)) Vote) Source #
gasDRepVotesL ∷ Lens' (GovActionState era) (Map (Credential 'DRepRole (EraCrypto era)) Vote) Source #
gasStakePoolVotesL ∷ Lens' (GovActionState era) (Map (KeyHash 'StakePool (EraCrypto era)) Vote) Source #
gasExpiresAfterL ∷ Lens' (GovActionState era) EpochNo Source #
gasActionL ∷ Lens' (GovActionState era) (GovAction era) Source #
gasReturnAddrL ∷ Lens' (GovActionState era) (RewardAccount (EraCrypto era)) Source #
gasProposedInL ∷ Lens' (GovActionState era) EpochNo Source #
gasProposalProcedureL ∷ Lens' (GovActionState era) (ProposalProcedure era) Source #
gasDeposit ∷ GovActionState era → Coin Source #
gasAction ∷ GovActionState era → GovAction era Source #
gasReturnAddr ∷ GovActionState era → RewardAccount (EraCrypto era) Source #
pProcDepositL ∷ Lens' (ProposalProcedure era) Coin Source #
pProcGovActionL ∷ Lens' (ProposalProcedure era) (GovAction era) Source #
pProcReturnAddrL ∷ Lens' (ProposalProcedure era) (RewardAccount (EraCrypto era)) Source #
pProcAnchorL ∷ Lens' (ProposalProcedure era) (Anchor (EraCrypto era)) Source #
newEpochStateDRepPulsingStateL ∷ ConwayEraGov era ⇒ Lens' (NewEpochState era) (DRepPulsingState era) Source #
epochStateDRepPulsingStateL ∷ ConwayEraGov era ⇒ Lens' (EpochState era) (DRepPulsingState era) Source #
epochStateStakeDistrL ∷ Lens' (EpochState era) (VMap VB VP (Credential 'Staking (EraCrypto era)) (CompactForm Coin)) Source #
epochStateIncrStakeDistrL ∷ Lens' (EpochState era) (Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin)) Source #
epochStateRegDrepL ∷ Lens' (EpochState era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era))) Source #
epochStateUMapL ∷ Lens' (EpochState era) (UMap (EraCrypto era)) Source #
pulseDRepPulsingState ∷ DRepPulsingState era → DRepPulsingState era Source #
completeDRepPulsingState ∷ DRepPulsingState era → DRepPulsingState era Source #
extractDRepPulsingState ∷ DRepPulsingState era → RatifyState era Source #
forceDRepPulsingState ∷ ConwayEraGov era ⇒ NewEpochState era → NewEpochState era Source #
Force computation of DRep stake distribution and figure out the next enact state. This operation is useful in cases when access to new EnactState or DRep stake distribution is needed more than once. It is safe to call this function at any point. Whenever pulser is already in computed state this will be a noop.
finishDRepPulser ∷ ∀ era. DRepPulsingState era → (PulsingSnapshot era, RatifyState era) Source #
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) Source #
We iterate over a pulse-sized chunk of the UMap.
For each staking credential in the chunk that has delegated to a DRep, add the stake distribution, rewards, and proposal deposits for that credential to the DRep distribution, if the DRep is a DRepCredential (also, AlwaysAbstain or AlwaysNoConfidence) and a member of the registered DReps. If the DRepCredential is not a member of the registered DReps, ignore and skip that DRep.
For each staking credential in the chunk that has delegated to an SPO, add only the proposal deposits for that credential to the stake pool distribution, since the rewards and stake are already added to it by the SNAP rule.
Give or take, this operation has roughly
O (a * (log(b) + log(c) + log(d) + log(e) + log(f)))
complexity, where,
(a) is the size of the chunk of the UMap, which is the pulse-size, iterate over
(b) is the size of the StakeDistr, lookup
(c) is the size of the DRepDistr, insertWith
(d) is the size of the dpProposalDeposits, lookup
(e) is the size of the registered DReps, lookup
(f) is the size of the PoolDistr, insert
getRatifyState ∷ ConwayGovState era → RatifyState era Source #
conwayGovStateDRepDistrG ∷ SimpleGetter (ConwayGovState era) (Map (DRep (EraCrypto era)) (CompactForm Coin)) Source #
psDRepDistrG ∷ SimpleGetter (DRepPulsingState era) (Map (DRep (EraCrypto era)) (CompactForm Coin)) Source #
This is potentially an expensive getter. Make sure not to use it in the first 80% of the epoch.
data PulsingSnapshot era Source #
A snapshot of information from the previous epoch stored inside the Pulser.
After the pulser completes, but before the epoch turns, this information
is store in the DRComplete
constructor of the DRepPulsingState
These are the values at the start of the current epoch. This allows the API
To access these "previous" values, both during and after pulsing.
PulsingSnapshot | |
|
Instances
setCompleteDRepPulsingState ∷ GovState era ~ ConwayGovState era ⇒ PulsingSnapshot era → RatifyState era → EpochState era → EpochState era Source #
setFreshDRepPulsingState ∷ (GovState era ~ ConwayGovState era, Monad m, RunConwayRatify era, ConwayEraGov era) ⇒ EpochNo → PoolDistr (EraCrypto era) → EpochState era → ReaderT Globals m (EpochState era) Source #
Refresh the pulser in the EpochState using all the new data that is needed to compute the RatifyState when pulsing completes.
psProposalsL ∷ Lens' (PulsingSnapshot era) (StrictSeq (GovActionState era)) Source #
psDRepDistrL ∷ Lens' (PulsingSnapshot era) (Map (DRep (EraCrypto era)) (CompactForm Coin)) Source #
psDRepStateL ∷ Lens' (PulsingSnapshot era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era))) Source #
psPoolDistrL ∷ Lens' (PulsingSnapshot era) (Map (KeyHash 'StakePool (EraCrypto era)) (CompactForm Coin)) Source #
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 Source #
Nothing
runConwayRatify ∷ Globals → RatifyEnv era → RatifyState era → RatifySignal era → RatifyState era Source #
Instances
Crypto c ⇒ RunConwayRatify (ConwayEra c) Source # | |
Defined in Cardano.Ledger.Conway runConwayRatify ∷ Globals → RatifyEnv (ConwayEra c) → RatifyState (ConwayEra c) → RatifySignal (ConwayEra c) → RatifyState (ConwayEra c) Source # |
govStatePrevGovActionIds ∷ ConwayEraGov era ⇒ GovState era → GovRelation StrictMaybe era Source #
mkEnactState ∷ ConwayEraGov era ⇒ GovState era → EnactState era Source #
ratifySignalL ∷ Lens' (RatifySignal era) (StrictSeq (GovActionState era)) Source #
reStakeDistrL ∷ Lens' (RatifyEnv era) (Map (Credential 'Staking (EraCrypto era)) (CompactForm Coin)) Source #
reDRepDistrL ∷ Lens' (RatifyEnv era) (Map (DRep (EraCrypto era)) (CompactForm Coin)) Source #
reDRepStateL ∷ Lens' (RatifyEnv era) (Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era))) Source #
reCommitteeStateL ∷ Lens' (RatifyEnv era) (CommitteeState era) Source #
data DefaultVote Source #
Default vote that will be used for Stake Pool.
DefaultNo | Reward account is delegated to a |
DefaultAbstain | Reward account is delegated to |
DefaultNoConfidence | Reward account is delegated to |
Instances
Show DefaultVote Source # | |
Defined in Cardano.Ledger.Conway.Governance | |
Eq DefaultVote Source # | |
Defined in Cardano.Ledger.Conway.Governance (==) ∷ DefaultVote → DefaultVote → Bool Source # (/=) ∷ DefaultVote → DefaultVote → Bool Source # |
∷ KeyHash 'StakePool c | Specify the key hash of the pool whose default vote should be returned. |
→ Map (KeyHash 'StakePool c) (PoolParams c) | Registered Stake Pools |
→ Map (Credential 'Staking c) (DRep c) | Delegations of staking credneitals to a DRep |
→ DefaultVote |
Exported for testing
pparamsUpdateThreshold ∷ ∀ era. ConwayEraPParams era ⇒ DRepVotingThresholds → PParamsUpdate era → UnitInterval Source #
Wraper type, which serves as a composition of Tree
. StrictMaybe
Also its Show instance will print a nice tree structure.
TreeMaybe | |
|
toGovRelationTree ∷ (Era era, HasCallStack) ⇒ Proposals era → GovRelation TreeMaybe era Source #
Partial version of toGovRelationTreeEither
toGovRelationTreeEither ∷ Era era ⇒ Proposals era → Either String (GovRelation TreeMaybe era) Source #
showGovActionType ∷ GovAction era → String Source #
Orphan instances
EraPParams (ConwayEra c) ⇒ EraGov (ConwayEra c) Source # | |
emptyGovState ∷ GovState (ConwayEra c) Source # getProposedPPUpdates ∷ GovState (ConwayEra c) → Maybe (ProposedPPUpdates (ConwayEra c)) Source # curPParamsGovStateL ∷ Lens' (GovState (ConwayEra c)) (PParams (ConwayEra c)) Source # prevPParamsGovStateL ∷ Lens' (GovState (ConwayEra c)) (PParams (ConwayEra c)) Source # futurePParamsGovStateL ∷ Lens' (GovState (ConwayEra c)) (FuturePParams (ConwayEra c)) Source # obligationGovState ∷ GovState (ConwayEra c) → Obligations Source # |