cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 types

data ParamChange 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 -> ParamChange

The linear factor for the minimum fee calculation

FeeFixed :: Integer -> ParamChange

The constant factor for the minimum fee calculation

MaxBlockBodySize :: Integer -> ParamChange

Maximal block body size

MaxTxSize :: Integer -> ParamChange

Maximal transaction size

MaxBlockHeaderSize :: Integer -> ParamChange

Maximal block header size

KeyDeposit :: Integer -> ParamChange

The amount of a key registration deposit

PoolDeposit :: Integer -> ParamChange

The amount of a pool registration deposit

PoolRetirementMaxEpoch :: Integer -> ParamChange

Maximum number of epochs in the future a pool retirement is allowed to be scheduled future for.

PoolNumber :: Integer -> ParamChange

Desired number of pools

PoolInfluence :: Rational -> ParamChange

Pool influence

MonetaryExpansion :: Rational -> ParamChange

Monetary expansion

TreasuryCut :: Rational -> ParamChange

Treasury expansion

MinPoolCost :: Integer -> ParamChange

Minimum Stake Pool Cost

CoinsPerUTxOByte :: Integer -> ParamChange

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 -> ParamChange

Max size of a Value in an output

CollateralPercentage :: Integer -> ParamChange

Percentage of the txfee which must be provided as collateral when including non-native scripts.

MaxCollateralInputs :: Integer -> ParamChange

Maximum number of collateral inputs allowed in a transaction

PoolVotingThresholds

Thresholds for pool votes

DRepVotingThresholds

Thresholds for DRep votes

CommitteeMinSize :: Integer -> ParamChange

Minimum size of the Constitutional Committee

CommitteeMaxTermLength :: Integer -> ParamChange

The Constitutional Committee Term limit in number of Slots

GovActionLifetime :: Integer -> ParamChange

Gov action lifetime in number of Epochs

GovActionDeposit :: Integer -> ParamChange

The amount of the Gov Action deposit

DRepRegistrationDeposit :: Integer -> ParamChange

The amount of a DRep registration deposit

DRepActivity :: Integer -> ParamChange

The number of Epochs that a DRep can perform no activity without losing their Active status.

MinFeeRefScriptCostPerByte :: Rational -> ParamChange

Reference scripts fee for the minimum fee calculation

data TxSkelProposal where Source #

This bundles a governance action into an actual proposal

Constructors

TxSkelProposal 

Fields

Optics

txSkelProposalMConstitutionAT :: forall kind. Typeable kind => AffineTraversal' TxSkelProposal (Maybe (User kind Redemption)) Source #

Focuses on the optional constitution of a TxSkelProposal

txSkelProposalGovernanceActionAT :: forall req. Typeable req => AffineTraversal' TxSkelProposal (GovernanceAction req) Source #

Focuses on the governance action 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.