Skip to content

Commit

Permalink
Merge pull request #340 from input-output-hk/newhoggy/delete-Protocol…
Browse files Browse the repository at this point in the history
…UTxOCostPerByteFeature

Delete `ProtocolUTxOCostPerByteFeature`
  • Loading branch information
newhoggy authored Oct 25, 2023
2 parents 225ac3c + 4cb00d2 commit f2ab681
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
4 changes: 2 additions & 2 deletions cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ genProtocolParameters era = do
protocolParamMaxValueSize <- Gen.maybe genNat
protocolParamCollateralPercent <- Gen.maybe genNat
protocolParamMaxCollateralInputs <- Gen.maybe genNat
protocolParamUTxOCostPerByte <- inEonForEra @ProtocolUTxOCostPerByteFeature (pure Nothing) (const (Just <$> genLovelace)) era
protocolParamUTxOCostPerByte <- inEonForEra @BabbageEraOnwards (pure Nothing) (const (Just <$> genLovelace)) era

pure ProtocolParameters {..}

Expand Down Expand Up @@ -945,7 +945,7 @@ genProtocolParametersUpdate era = do
protocolUpdateMaxValueSize <- Gen.maybe genNat
protocolUpdateCollateralPercent <- Gen.maybe genNat
protocolUpdateMaxCollateralInputs <- Gen.maybe genNat
protocolUpdateUTxOCostPerByte <- inEonForEra @ProtocolUTxOCostPerByteFeature (pure Nothing) (const (Just <$> genLovelace)) era
protocolUpdateUTxOCostPerByte <- inEonForEra @BabbageEraOnwards (pure Nothing) (const (Just <$> genLovelace)) era

pure ProtocolParametersUpdate{..}

Expand Down
32 changes: 0 additions & 32 deletions cardano-api/internal/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ module Cardano.Api.ProtocolParameters (
AsType(..),

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

Expand Down Expand Up @@ -983,37 +982,6 @@ instance FromCBOR ProtocolParametersUpdate where
<*> fromCBOR
<*> fromCBOR

-- ----------------------------------------------------------------------------
-- Features
--

-- | A representation of whether the era supports the 'UTxO Cost Per Byte'
-- protocol parameter.
--
-- The Babbage and subsequent eras support such a protocol parameter.
--
data ProtocolUTxOCostPerByteFeature era where
ProtocolUTxOCostPerByteInBabbageEra :: ProtocolUTxOCostPerByteFeature BabbageEra
ProtocolUTxOCostPerByteInConwayEra :: ProtocolUTxOCostPerByteFeature ConwayEra

deriving instance Eq (ProtocolUTxOCostPerByteFeature era)
deriving instance Show (ProtocolUTxOCostPerByteFeature era)

instance Eon ProtocolUTxOCostPerByteFeature where
inEonForEra no yes = \case
ByronEra -> no
ShelleyEra -> no
AllegraEra -> no
MaryEra -> no
AlonzoEra -> no
BabbageEra -> yes ProtocolUTxOCostPerByteInBabbageEra
ConwayEra -> yes ProtocolUTxOCostPerByteInConwayEra

instance ToCardanoEra ProtocolUTxOCostPerByteFeature where
toCardanoEra = \case
ProtocolUTxOCostPerByteInBabbageEra -> BabbageEra
ProtocolUTxOCostPerByteInConwayEra -> ConwayEra

-- | A representation of whether the era supports the 'UTxO Cost Per Word'
-- protocol parameter.
--
Expand Down
1 change: 0 additions & 1 deletion cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ module Cardano.Api (
ViewTx,

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

-- ** Fee calculation
Expand Down

0 comments on commit f2ab681

Please sign in to comment.