| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Protocol.Parameters.Update
Description
Sparse typed changes to protocol parameters. Nothing leaves a field
unchanged. For nullable leverage and bootstrap round, Just Nothing explicitly
removes the bound or round. The original imported encoding is available
separately from fresh serialization, which may normalize representation.
import qualified Cometa.Protocol.Parameters.Update as Update
change :: Update.Update
change = Update.empty { Update.updateMinFeeB = Just 155381 }
Synopsis
- data Update = Update {
- updateMinFeeA :: !(Maybe Word64)
- updateMinFeeB :: !(Maybe Word64)
- updateMaxBlockBodySize :: !(Maybe Word64)
- updateMaxTxSize :: !(Maybe Word64)
- updateMaxBlockHeaderSize :: !(Maybe Word64)
- updateKeyDeposit :: !(Maybe Word64)
- updatePoolDeposit :: !(Maybe Word64)
- updateMaxEpoch :: !(Maybe Word64)
- updateDesiredPoolCount :: !(Maybe Word64)
- updatePoolPledgeInfluence :: !(Maybe NonNegativeRational)
- updateExpansionRate :: !(Maybe UnitInterval)
- updateTreasuryGrowthRate :: !(Maybe UnitInterval)
- updateDecentralization :: !(Maybe UnitInterval)
- updateExtraEntropy :: !(Maybe Nonce)
- updateProtocolVersion :: !(Maybe ProtocolVersion)
- updateMinPoolCost :: !(Maybe Word64)
- updateAdaPerUtxoByte :: !(Maybe Word64)
- updateCostModels :: !(Maybe CostModels)
- updateExecutionCosts :: !(Maybe ExUnitPrices)
- updateMaxTxExUnits :: !(Maybe ExUnits)
- updateMaxBlockExUnits :: !(Maybe ExUnits)
- updateMaxValueSize :: !(Maybe Word64)
- updateCollateralPercentage :: !(Maybe Word64)
- updateMaxCollateralInputs :: !(Maybe Word64)
- updatePoolVotingThresholds :: !(Maybe PoolVotingThresholds)
- updateDrepVotingThresholds :: !(Maybe DRepVotingThresholds)
- updateMinCommitteeSize :: !(Maybe Word64)
- updateCommitteeTermLimit :: !(Maybe Word64)
- updateGovernanceActionValidityPeriod :: !(Maybe Word64)
- updateGovernanceActionDeposit :: !(Maybe Word64)
- updateDrepDeposit :: !(Maybe Word64)
- updateDrepInactivityPeriod :: !(Maybe Word64)
- updateRefScriptCostPerByte :: !(Maybe NonNegativeRational)
- updateMaxRefScriptSizePerBlock :: !(Maybe Word32)
- updateMaxRefScriptSizePerTx :: !(Maybe Word32)
- updateRefScriptCostStride :: !(Maybe ReferenceScriptCostStride)
- updateRefScriptCostMultiplier :: !(Maybe NonNegativeRational)
- updateMaxPledgeLeverage :: !(Maybe (Maybe NonNegativeRational))
- updateMinPoolMargin :: !(Maybe UnitInterval)
- updateLeiosAnnouncementPeriodLength :: !(Maybe Word32)
- updateLeiosVotePeriodLength :: !(Maybe Word32)
- updateLeiosDiffusionPeriodLength :: !(Maybe Word32)
- updateLeiosCommitteeSize :: !(Maybe Word16)
- updateLeiosQuorumStakeThreshold :: !(Maybe UnitInterval)
- updateMaxEndorserBlockReferencesSize :: !(Maybe Word32)
- updateMaxEndorserBlockTxsSize :: !(Maybe Word32)
- updateMaxEndorserBlockExecutionUnits :: !(Maybe ExUnits)
- updateMaxRefScriptSizePerEndorserBlock :: !(Maybe Word32)
- updatePerasMinCandidateBlockAge :: !(Maybe Word32)
- updatePerasHealingFactor :: !(Maybe NonNegativeRational)
- updatePerasCertBoost :: !(Maybe Word16)
- updatePerasTargetCommitteeSize :: !(Maybe Word16)
- updatePerasBootstrapRound :: !(Maybe (Maybe Word32))
- updatePerasQuorumThresholdSafetyMargin :: !(Maybe UnitInterval)
- updateRefInputsCostPerMultiAssetPolicy :: !(Maybe Word64)
- updateRefInputsCostPerDatumByte :: !(Maybe Word64)
- empty :: Update
- apply :: Update -> Parameters -> Parameters
- fromParameters :: Parameters -> Update
- data EncodedUpdate
- encodeCbor :: Update -> ByteString
- decodeCbor :: ByteString -> Either Error EncodedUpdate
- toCbor :: EncodedUpdate -> ByteString
- toUpdate :: EncodedUpdate -> Update
- toPlutusData :: Update -> IO (Either Error PlutusData)
Documentation
Independent optional changes. All constituent values are validated once; constructing or applying a change is pure and cannot fail. Construction does not validate activation or governance rules of a particular ledger era.
Constructors
| Update | |
Fields
| |
apply :: Update -> Parameters -> Parameters Source #
Apply all present fields to a complete snapshot, preserving absent fields.
fromParameters :: Parameters -> Update Source #
Produce a change setting each available field, including explicit nulls. Unavailable fields are omitted.
data EncodedUpdate Source #
A validated update with its exact original CBOR bytes. Equality and ordering compare those bytes, so alternative encodings of the same change can differ.
Instances
| Show EncodedUpdate Source # | |
Defined in Cometa.Protocol.Parameters.Update Methods showsPrec :: Int -> EncodedUpdate -> ShowS # show :: EncodedUpdate -> String # showList :: [EncodedUpdate] -> ShowS # | |
| Eq EncodedUpdate Source # | |
Defined in Cometa.Protocol.Parameters.Update Methods (==) :: EncodedUpdate -> EncodedUpdate -> Bool # (/=) :: EncodedUpdate -> EncodedUpdate -> Bool # | |
| Ord EncodedUpdate Source # | |
Defined in Cometa.Protocol.Parameters.Update Methods compare :: EncodedUpdate -> EncodedUpdate -> Ordering # (<) :: EncodedUpdate -> EncodedUpdate -> Bool # (<=) :: EncodedUpdate -> EncodedUpdate -> Bool # (>) :: EncodedUpdate -> EncodedUpdate -> Bool # (>=) :: EncodedUpdate -> EncodedUpdate -> Bool # max :: EncodedUpdate -> EncodedUpdate -> EncodedUpdate # min :: EncodedUpdate -> EncodedUpdate -> EncodedUpdate # | |
encodeCbor :: Update -> ByteString Source #
Serialize present fields in ascending parameter-key order, using definite
collections and minimal integer encodings. Rational pairs remain exact;
imported representation is preserved only by toCbor.
decodeCbor :: ByteString -> Either Error EncodedUpdate Source #
Decode one complete update, retaining exact bytes. Unknown or duplicate
parameter keys, invalid field bounds/arity, malformed CBOR and trailing input
return InvalidProtocolParametersCbor. Historical fields are accepted without
applying era-specific governance validity rules.
toCbor :: EncodedUpdate -> ByteString Source #
Return the exact validated input encoding.
toUpdate :: EncodedUpdate -> Update Source #
Inspect the Haskell-owned change without altering its original encoding.
toPlutusData :: Update -> IO (Either Error PlutusData) Source #
Encode changed parameters for a Plutus governance script. The result is a
map keyed by parameter identifiers; absent fields are omitted. Rational values
are reduced fractions represented as numerator/denominator lists. Historical
decentralization, entropy and protocol-version changes are excluded. This is
script data, distinct from protocol-update CBOR, and does not validate whether
the changes are permitted in a particular ledger era. Conversion failures
return NativeError.