Skip to content

Commit

Permalink
New ProtocolUpdateUTxOCostPerWordSupportedInEra type
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jun 5, 2023
1 parent 3bc87dc commit 86e9b59
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cardano-api/internal/Cardano/Api/ProtocolParameters.hs
Expand Up @@ -74,6 +74,7 @@ module Cardano.Api.ProtocolParameters (

-- ** Era-dependent protocol features
ProtocolUTxOCostPerByteFeature(..),
ProtocolUTxOCostPerWordFeature(..),

) where

Expand Down Expand Up @@ -699,6 +700,27 @@ instance FeatureInEra ProtocolUTxOCostPerByteFeature where
BabbageEra -> yes ProtocolUTxOCostPerByteInBabbageEra
ConwayEra -> yes ProtocolUTxOCostPerByteInConwayEra

-- | A representation of whether the era supports the 'UTxO Cost Per Word'
-- protocol parameter.
--
-- The Babbage and subsequent eras support such a protocol parameter.
--
data ProtocolUTxOCostPerWordFeature era where
ProtocolUpdateUTxOCostPerWordInAlonzoEra :: ProtocolUTxOCostPerWordFeature AlonzoEra

deriving instance Eq (ProtocolUTxOCostPerWordFeature era)
deriving instance Show (ProtocolUTxOCostPerWordFeature era)

instance FeatureInEra ProtocolUTxOCostPerWordFeature where
featureInEra no yes = \case
ByronEra -> no
ShelleyEra -> no
AllegraEra -> no
MaryEra -> no
AlonzoEra -> yes ProtocolUpdateUTxOCostPerWordInAlonzoEra
BabbageEra -> no
ConwayEra -> no

-- ----------------------------------------------------------------------------
-- Praos nonce
--
Expand Down
1 change: 1 addition & 0 deletions cardano-api/internal/Cardano/Api/TxBody.hs
Expand Up @@ -177,6 +177,7 @@ module Cardano.Api.TxBody (

-- * Data family instances
AsType(AsTxId, AsTxBody, AsByronTxBody, AsShelleyTxBody, AsMaryTxBody),

) where

import Cardano.Api.Address
Expand Down
1 change: 1 addition & 0 deletions cardano-api/src/Cardano/Api.hs
Expand Up @@ -296,6 +296,7 @@ module Cardano.Api (

-- ** Era-dependent protocol features
ProtocolUTxOCostPerByteFeature(..),
ProtocolUTxOCostPerWordFeature(..),

-- ** Fee calculation
LedgerEpochInfo(..),
Expand Down

0 comments on commit 86e9b59

Please sign in to comment.