| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.Skeleton.Proposal
Description
This module exposes the proposals constructs used in a
TxSkel and their associated utilities. To issue proposals
in a skeleton, the usual way is to invoke txSkelProposals = [simpleProposal
script govAction1, simpleProposal pk govAction2, ... ]
Synopsis
- data ParameterChange where
- FeePerByte :: Integer -> ParameterChange
- FeeFixed :: Integer -> ParameterChange
- MaxBlockBodySize :: Integer -> ParameterChange
- MaxTxSize :: Integer -> ParameterChange
- MaxBlockHeaderSize :: Integer -> ParameterChange
- KeyDeposit :: Integer -> ParameterChange
- PoolDeposit :: Integer -> ParameterChange
- PoolRetirementMaxEpoch :: Integer -> ParameterChange
- PoolNumber :: Integer -> ParameterChange
- PoolInfluence :: Rational -> ParameterChange
- MonetaryExpansion :: Rational -> ParameterChange
- TreasuryCut :: Rational -> ParameterChange
- MinPoolCost :: Integer -> ParameterChange
- CoinsPerUTxOByte :: Integer -> ParameterChange
- CostModels :: {..} -> ParameterChange
- Prices :: {..} -> ParameterChange
- MaxTxExUnits :: {..} -> ParameterChange
- MaxBlockExUnits :: {..} -> ParameterChange
- MaxValSize :: Integer -> ParameterChange
- CollateralPercentage :: Integer -> ParameterChange
- MaxCollateralInputs :: Integer -> ParameterChange
- PoolVotingThresholds :: {..} -> ParameterChange
- DRepVotingThresholds :: {..} -> ParameterChange
- CommitteeMinSize :: Integer -> ParameterChange
- CommitteeMaxTermLength :: Integer -> ParameterChange
- GovActionLifetime :: Integer -> ParameterChange
- GovActionDeposit :: Integer -> ParameterChange
- DRepRegistrationDeposit :: Integer -> ParameterChange
- DRepActivity :: Integer -> ParameterChange
- MinFeeRefScriptCostPerByte :: Rational -> ParameterChange
- data GovernanceAction :: UserKind -> Type where
- ParameterChange :: [ParameterChange] -> GovernanceAction IsScript
- TreasuryWithdrawals :: Map Credential Lovelace -> GovernanceAction IsScript
- HardForkInitiation :: ProtocolVersion -> GovernanceAction IsNone
- NoConfidence :: GovernanceAction IsNone
- UpdateCommittee :: [ColdCommitteeCredential] -> Map ColdCommitteeCredential Integer -> Rational -> GovernanceAction IsNone
- NewConstitution :: Constitution -> GovernanceAction IsNone
- data TxSkelProposal where
- TxSkelProposal :: (Typeable kind, ToCredential cred) => {..} -> TxSkelProposal
- txSkelProposalAnchorL :: Lens' TxSkelProposal TxSkelAnchor
- txSkelProposalMConstitutionAT :: forall kind. Typeable kind => AffineTraversal' TxSkelProposal (Maybe (User kind Redemption))
- txSkelProposalReturnCredentialL :: Lens' TxSkelProposal Credential
- txSkelProposalGovernanceActionAT :: forall req. Typeable req => AffineTraversal' TxSkelProposal (GovernanceAction req)
- txSkelProposalConstitutionAT :: AffineTraversal' TxSkelProposal (User IsScript Redemption)
- simpleProposal :: (ToCredential cred, Typeable kind) => cred -> GovernanceAction kind -> TxSkelProposal
- fillConstitution :: (ToVScript script, Typeable script) => script -> TxSkelProposal -> TxSkelProposal
Data types
data ParameterChange where Source #
These are all the protocol parameters. They are taken from https://github.com/IntersectMBO/cardano-ledger/blob/c4fbc05999866fea7c0cb1b211fd5288f286b95d/eras/conway/impl/cddl-files/conway.cddl#L381-L412 and will most likely change in future eras.
Constructors
| FeePerByte :: Integer -> ParameterChange | The linear factor for the minimum fee calculation |
| FeeFixed :: Integer -> ParameterChange | The constant factor for the minimum fee calculation |
| MaxBlockBodySize :: Integer -> ParameterChange | Maximal block body size |
| MaxTxSize :: Integer -> ParameterChange | Maximal transaction size |
| MaxBlockHeaderSize :: Integer -> ParameterChange | Maximal block header size |
| KeyDeposit :: Integer -> ParameterChange | The amount of a key registration deposit |
| PoolDeposit :: Integer -> ParameterChange | The amount of a pool registration deposit |
| PoolRetirementMaxEpoch :: Integer -> ParameterChange | Maximum number of epochs in the future a pool retirement is allowed to be scheduled future for. |
| PoolNumber :: Integer -> ParameterChange | Desired number of pools |
| PoolInfluence :: Rational -> ParameterChange | Pool influence |
| MonetaryExpansion :: Rational -> ParameterChange | Monetary expansion |
| TreasuryCut :: Rational -> ParameterChange | Treasury expansion |
| MinPoolCost :: Integer -> ParameterChange | Minimum Stake Pool Cost |
| CoinsPerUTxOByte :: Integer -> ParameterChange | Cost in lovelace per byte of UTxO storage |
| CostModels | Cost models for non-native script languages |
Fields
| |
| Prices | Prices of execution units |
Fields
| |
| MaxTxExUnits | Max total script execution resources units allowed per tx |
Fields
| |
| MaxBlockExUnits | Max total script execution resources units allowed per block |
Fields
| |
| MaxValSize :: Integer -> ParameterChange | Max size of a Value in an output |
| CollateralPercentage :: Integer -> ParameterChange | Percentage of the txfee which must be provided as collateral when including non-native scripts. |
| MaxCollateralInputs :: Integer -> ParameterChange | Maximum number of collateral inputs allowed in a transaction |
| PoolVotingThresholds | Thresholds for pool votes |
Fields
| |
| DRepVotingThresholds | Thresholds for DRep votes |
Fields
| |
| CommitteeMinSize :: Integer -> ParameterChange | Minimum size of the Constitutional Committee |
| CommitteeMaxTermLength :: Integer -> ParameterChange | The Constitutional Committee Term limit in number of Slots |
| GovActionLifetime :: Integer -> ParameterChange | Gov action lifetime in number of Epochs |
| GovActionDeposit :: Integer -> ParameterChange | The amount of the Gov Action deposit |
| DRepRegistrationDeposit :: Integer -> ParameterChange | The amount of a DRep registration deposit |
| DRepActivity :: Integer -> ParameterChange | The number of Epochs that a DRep can perform no activity without losing
their |
| MinFeeRefScriptCostPerByte :: Rational -> ParameterChange | Reference scripts fee for the minimum fee calculation |
Instances
| Show ParameterChange Source # | |
Defined in Cooked.Skeleton.Proposal Methods showsPrec :: Int -> ParameterChange -> ShowS # show :: ParameterChange -> String # showList :: [ParameterChange] -> ShowS # | |
| PrettyCooked ParameterChange Source # | |
Defined in Cooked.Pretty.Skeleton Methods prettyCookedOpt :: PrettyCookedOpts -> ParameterChange -> DocCooked Source # | |
| Eq ParameterChange Source # | |
Defined in Cooked.Skeleton.Proposal Methods (==) :: ParameterChange -> ParameterChange -> Bool # (/=) :: ParameterChange -> ParameterChange -> Bool # | |
data GovernanceAction :: UserKind -> Type where Source #
This lists the various possible governance actions. Only two of these
action need to be witnessed by the constitution script, which are annotated
by IsScript.
Constructors
Instances
| Show (GovernanceAction a) Source # | |
Defined in Cooked.Skeleton.Proposal Methods showsPrec :: Int -> GovernanceAction a -> ShowS # show :: GovernanceAction a -> String # showList :: [GovernanceAction a] -> ShowS # | |
| PrettyCooked (GovernanceAction a) Source # | |
Defined in Cooked.Pretty.Skeleton Methods prettyCookedOpt :: PrettyCookedOpts -> GovernanceAction a -> DocCooked Source # prettyCooked :: GovernanceAction a -> DocCooked Source # | |
| Eq (GovernanceAction a) Source # | |
Defined in Cooked.Skeleton.Proposal Methods (==) :: GovernanceAction a -> GovernanceAction a -> Bool # (/=) :: GovernanceAction a -> GovernanceAction a -> Bool # | |
data TxSkelProposal where Source #
This bundles a governance action into an actual proposal
Constructors
| TxSkelProposal | |
Fields
| |
Instances
| Show TxSkelProposal Source # | |
Defined in Cooked.Skeleton.Proposal Methods showsPrec :: Int -> TxSkelProposal -> ShowS # show :: TxSkelProposal -> String # showList :: [TxSkelProposal] -> ShowS # | |
| PrettyCookedList TxSkelProposal Source # | |
Defined in Cooked.Pretty.Skeleton Methods prettyCookedOptList :: PrettyCookedOpts -> TxSkelProposal -> [DocCooked] Source # prettyCookedOptListMaybe :: PrettyCookedOpts -> TxSkelProposal -> [Maybe DocCooked] Source # prettyCookedList :: TxSkelProposal -> [DocCooked] Source # | |
| Eq TxSkelProposal Source # | |
Defined in Cooked.Skeleton.Proposal Methods (==) :: TxSkelProposal -> TxSkelProposal -> Bool # (/=) :: TxSkelProposal -> TxSkelProposal -> Bool # | |
Optics
txSkelProposalAnchorL :: Lens' TxSkelProposal TxSkelAnchor Source #
A lens to get or set the anchor of a TxSkelProposal
txSkelProposalMConstitutionAT :: forall kind. Typeable kind => AffineTraversal' TxSkelProposal (Maybe (User kind Redemption)) Source #
Focuses on the optional constitution of a TxSkelProposal
txSkelProposalReturnCredentialL :: Lens' TxSkelProposal Credential Source #
Focuses on the return credential from a TxSkelProposal
txSkelProposalGovernanceActionAT :: forall req. Typeable req => AffineTraversal' TxSkelProposal (GovernanceAction req) Source #
Focuses on the governance action of a TxSkelProposal
txSkelProposalConstitutionAT :: AffineTraversal' TxSkelProposal (User IsScript Redemption) Source #
Focuses on the constitution of a TxSkelProposal
Smart constructors
simpleProposal :: (ToCredential cred, Typeable kind) => cred -> GovernanceAction kind -> TxSkelProposal Source #
Builds a TxSkelProposal from a credential and a gov action. Does not set
any constitution (when applicable) nor anchor.
Utilities
fillConstitution :: (ToVScript script, Typeable script) => script -> TxSkelProposal -> TxSkelProposal Source #
Sets the constitution script with an empty redeemer when empty. This will not tamper with an existing constitution script and redeemer.