Skip to content

Commit

Permalink
Merge pull request #230 from input-output-hk/newhoggy/delete-deprecat…
Browse files Browse the repository at this point in the history
…ed-functions-and-types

Delete deprecated functions and types
  • Loading branch information
newhoggy authored Sep 8, 2023
2 parents 6cf16e5 + a722fa4 commit 6b18972
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 132 deletions.
2 changes: 0 additions & 2 deletions cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ genHashableScriptData = do
Left e -> error $ "genHashableScriptData: " <> show e
Right r -> return r


{-# DEPRECATED genScriptData "Use genHashableScriptData" #-}
genScriptData :: Gen ScriptData
genScriptData =
Expand Down Expand Up @@ -298,7 +297,6 @@ genScriptData =
Gen.list (Range.linear 0 (fromIntegral sz)) $
(,) <$> genScriptData <*> genScriptData


-- ----------------------------------------------------------------------------
-- Script generators for any language, or any language valid in a specific era
--
Expand Down
28 changes: 0 additions & 28 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module Cardano.Api.Certificate (
makeStakeAddressDelegationCertificate,
makeStakeAddressRegistrationCertificate,
makeStakeAddressUnregistrationCertificate,
makeStakeAddressPoolDelegationCertificate,
PoolId,

-- * Registering stake pools
Expand Down Expand Up @@ -468,33 +467,6 @@ makeStakeAddressUnregistrationCertificate req =
(toShelleyStakeCredential scred)
(toShelleyLovelace deposit)

{-# DEPRECATED makeStakeAddressPoolDelegationCertificate "This function is deprecated, please use 'makeStakeAddressDelegationCertificate' instead." #-}
makeStakeAddressPoolDelegationCertificate :: ()
=> ShelleyBasedEra era
-> StakeCredential
-> PoolId
-> Certificate era
makeStakeAddressPoolDelegationCertificate sbe scred poolId =
case sbe of
ShelleyBasedEraShelley ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsPreConway ShelleyToBabbageEraShelley scred poolId)
ShelleyBasedEraAllegra ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsPreConway ShelleyToBabbageEraAllegra scred poolId)
ShelleyBasedEraMary ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsPreConway ShelleyToBabbageEraMary scred poolId)
ShelleyBasedEraAlonzo ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsPreConway ShelleyToBabbageEraAlonzo scred poolId)
ShelleyBasedEraBabbage ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsPreConway ShelleyToBabbageEraBabbage scred poolId)
ShelleyBasedEraConway ->
makeStakeAddressDelegationCertificate
(StakeDelegationRequirementsConwayOnwards ConwayEraOnwardsConway scred (Ledger.DelegStake $ unStakePoolKeyHash poolId))

data StakeDelegationRequirements era where
StakeDelegationRequirementsConwayOnwards
:: ConwayEraOnwards era
Expand Down
9 changes: 1 addition & 8 deletions cardano-api/internal/Cardano/Api/Eras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ module Cardano.Api.Eras
, inShelleyBasedEraFeatureMaybe
, maybeFeatureInShelleyBasedEra

-- * Deprecated aliases
, Byron
, Shelley
, Allegra
, Mary

-- * Shelley-based eras
, ShelleyBasedEra(..)
, IsShelleyBasedEra(..)
Expand All @@ -51,8 +45,7 @@ module Cardano.Api.Eras
, cardanoEraStyle

-- * Data family instances
, AsType(AsByronEra, AsShelleyEra, AsAllegraEra, AsMaryEra, AsAlonzoEra, AsBabbageEra, AsConwayEra,
AsByron, AsShelley, AsAllegra, AsMary, AsAlonzo, AsBabbage, AsConway)
, AsType(AsByronEra, AsShelleyEra, AsAllegraEra, AsMaryEra, AsAlonzoEra, AsBabbageEra, AsConwayEra)

-- * Assertions on era
, requireShelleyBasedEra
Expand Down
50 changes: 1 addition & 49 deletions cardano-api/internal/Cardano/Api/Eras/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ module Cardano.Api.Eras.Core
, inShelleyBasedEraFeatureMaybe
, maybeFeatureInShelleyBasedEra

-- * Deprecated aliases
, Byron
, Shelley
, Allegra
, Mary

-- * Shelley-based eras
, ShelleyBasedEra(..)
, IsShelleyBasedEra(..)
Expand All @@ -59,8 +53,7 @@ module Cardano.Api.Eras.Core
, cardanoEraStyle

-- * Data family instances
, AsType(AsByronEra, AsShelleyEra, AsAllegraEra, AsMaryEra, AsAlonzoEra, AsBabbageEra, AsConwayEra,
AsByron, AsShelley, AsAllegra, AsMary, AsAlonzo, AsBabbage, AsConway)
, AsType(AsByronEra, AsShelleyEra, AsAllegraEra, AsMaryEra, AsAlonzoEra, AsBabbageEra, AsConwayEra)

-- * Assertions on era
, requireShelleyBasedEra
Expand Down Expand Up @@ -205,47 +198,6 @@ inShelleyBasedEraFeatureMaybe :: ()
inShelleyBasedEraFeatureMaybe era yes =
inShelleyBasedEraFeature era Nothing (Just . yes)

-- ----------------------------------------------------------------------------
-- Deprecated aliases
--

type Byron = ByronEra
type Shelley = ShelleyEra
type Allegra = AllegraEra
type Mary = MaryEra

{-# DEPRECATED Byron "Use 'ByronEra' or 'ByronAddr' as appropriate" #-}
{-# DEPRECATED Shelley "Use 'ShelleyEra' or 'ShelleyAddr' as appropriate" #-}
{-# DEPRECATED Allegra "Use 'AllegraEra' instead" #-}
{-# DEPRECATED Mary "Use 'MaryEra' instead" #-}

pattern AsByron :: AsType ByronEra
pattern AsByron = AsByronEra

pattern AsShelley :: AsType ShelleyEra
pattern AsShelley = AsShelleyEra

pattern AsAllegra :: AsType AllegraEra
pattern AsAllegra = AsAllegraEra

pattern AsMary :: AsType MaryEra
pattern AsMary = AsMaryEra


pattern AsAlonzo :: AsType AlonzoEra
pattern AsAlonzo = AsAlonzoEra

pattern AsBabbage :: AsType BabbageEra
pattern AsBabbage = AsBabbageEra

pattern AsConway :: AsType ConwayEra
pattern AsConway = AsConwayEra

{-# DEPRECATED AsByron "Use 'AsByronEra' instead" #-}
{-# DEPRECATED AsShelley "Use 'AsShelleyEra' instead" #-}
{-# DEPRECATED AsAllegra "Use 'AsAllegraEra' instead" #-}
{-# DEPRECATED AsMary "Use 'AsMaryEra' instead" #-}

-- ----------------------------------------------------------------------------
-- Value level representation for Cardano eras
--
Expand Down
8 changes: 3 additions & 5 deletions cardano-api/internal/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ import Prettyprinter
import Prettyprinter.Render.String

{- HLINT ignore "Redundant return" -}

-- ----------------------------------------------------------------------------
-- Transaction fees
--
--- ----------------------------------------------------------------------------
--- Transaction fees
---

-- | For a concrete fully-constructed transaction, determine the minimum fee
-- that it needs to pay.
Expand All @@ -123,7 +122,6 @@ transactionFee txFeeFixed txFeePerByte tx =

{-# DEPRECATED transactionFee "Use 'evaluateTransactionFee' instead" #-}


--TODO: in the Byron case the per-byte is non-integral, would need different
-- parameters. e.g. a new data type for fee params, Byron vs Shelley

Expand Down
9 changes: 0 additions & 9 deletions cardano-api/internal/Cardano/Api/Query/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Cardano.Api.Query.Expr
, queryGenesisParameters
, queryPoolDistribution
, queryPoolState
, queryPparams
, queryProtocolParameters
, queryProtocolParametersUpdate
, queryProtocolState
Expand Down Expand Up @@ -126,14 +125,6 @@ queryPoolState :: ()
queryPoolState eraInMode sbe mPoolIds =
queryExpr $ QueryInEra eraInMode $ QueryInShelleyBasedEra sbe $ QueryPoolState mPoolIds

queryPparams :: ()
=> EraInMode era mode
-> ShelleyBasedEra era
-> LocalStateQueryExpr block point (QueryInMode mode) r IO (Either UnsupportedNtcVersionError (Either EraMismatch (L.PParams (ShelleyLedgerEra era))))
queryPparams eraInMode sbe =
queryExpr $ QueryInEra eraInMode $ QueryInShelleyBasedEra sbe QueryProtocolParameters
{-# DEPRECATED queryPparams "Use queryProtocolParameters instead" #-}

queryProtocolParameters :: ()
=> EraInMode era mode
-> ShelleyBasedEra era
Expand Down
7 changes: 0 additions & 7 deletions cardano-api/internal/Cardano/Api/ScriptData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ module Cardano.Api.ScriptData (
unsafeHashableScriptData,
ScriptData(..),

-- * Script data hashes
hashScriptData,

-- * Validating metadata
validateScriptData,
ScriptDataRangeError (..),
Expand Down Expand Up @@ -177,10 +174,6 @@ hashScriptDataBytes :: HashableScriptData -> Hash ScriptData
hashScriptDataBytes =
ScriptDataHash . Alonzo.hashData . (toAlonzoData :: HashableScriptData -> Alonzo.Data StandardAlonzo)

{-# DEPRECATED hashScriptData "Use hashScriptDataBytes" #-}
hashScriptData :: HashableScriptData -> Hash ScriptData
hashScriptData = hashScriptDataBytes

-- ----------------------------------------------------------------------------
-- Conversion functions
--
Expand Down
5 changes: 0 additions & 5 deletions cardano-api/internal/Cardano/Api/SerialiseRaw.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Cardano.Api.SerialiseRaw
, SerialiseAsRawBytesError(..)
, serialiseToRawBytesHex
, deserialiseFromRawBytesHex
, eitherDeserialiseFromRawBytes
, serialiseToRawBytesHexText
) where

Expand Down Expand Up @@ -37,10 +36,6 @@ class (HasTypeProxy a, Typeable a) => SerialiseAsRawBytes a where

deserialiseFromRawBytes :: AsType a -> ByteString -> Either SerialiseAsRawBytesError a

eitherDeserialiseFromRawBytes :: SerialiseAsRawBytes a => AsType a -> ByteString -> Either SerialiseAsRawBytesError a
eitherDeserialiseFromRawBytes = deserialiseFromRawBytes
{-# DEPRECATED eitherDeserialiseFromRawBytes "Use deserialiseFromRawBytes instead" #-}

serialiseToRawBytesHex :: SerialiseAsRawBytes a => a -> ByteString
serialiseToRawBytesHex = Base16.encode . serialiseToRawBytes

Expand Down
9 changes: 0 additions & 9 deletions cardano-api/internal/Cardano/Api/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module Cardano.Api.TxBody (
parseTxId,
-- * Transaction bodies
TxBody(.., TxBody),
makeTransactionBody,
createTransactionBody,
createAndValidateTransactionBody,
TxBodyContent(..),
Expand Down Expand Up @@ -2677,14 +2676,6 @@ createAndValidateTransactionBody =
LegacyByronEra -> makeByronTransactionBody
ShelleyBasedEra sbe -> makeShelleyTransactionBody sbe

{-# DEPRECATED makeTransactionBody "Use createAndValidateTransactionBody." #-}
makeTransactionBody :: forall era.
IsCardanoEra era
=> TxBodyContent BuildTx era
-> Either TxBodyError (TxBody era)
makeTransactionBody = createAndValidateTransactionBody


pattern TxBody :: TxBodyContent ViewTx era -> TxBody era
pattern TxBody txbodycontent <- (getTxBodyContent -> txbodycontent)
{-# COMPLETE TxBody #-}
Expand Down
10 changes: 0 additions & 10 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ module Cardano.Api (
writeTextFile,
writeTextOutput,

-- ** Deprecated
Byron,
Shelley,
Allegra,
Mary,
-- * Type tags
HasTypeProxy(..),
AsType(..),
Expand Down Expand Up @@ -220,7 +215,6 @@ module Cardano.Api (
-- ** Transaction bodies
TxBody(TxBody),
createAndValidateTransactionBody,
makeTransactionBody, -- TODO: Remove
TxBodyContent(..),

-- ** Transaction body builders
Expand Down Expand Up @@ -419,7 +413,6 @@ module Cardano.Api (
makeStakeAddressDelegationCertificate,
makeStakeAddressRegistrationCertificate,
makeStakeAddressUnregistrationCertificate,
makeStakeAddressPoolDelegationCertificate,

makeStakeAddressAndDRepDelegationCertificate,

Expand Down Expand Up @@ -506,7 +499,6 @@ module Cardano.Api (
getScriptData,
unsafeHashableScriptData,
ScriptData(..),
hashScriptData,

-- ** Validation
ScriptDataRangeError (..),
Expand Down Expand Up @@ -586,7 +578,6 @@ module Cardano.Api (
serialiseToRawBytes,
deserialiseFromRawBytes,
SerialiseAsRawBytesError(..),
eitherDeserialiseFromRawBytes,
serialiseToRawBytesHex,
deserialiseFromRawBytesHex,
serialiseToRawBytesHexText,
Expand Down Expand Up @@ -914,7 +905,6 @@ module Cardano.Api (
queryGenesisParameters,
queryPoolDistribution,
queryPoolState,
queryPparams,
queryProtocolParameters,
queryProtocolParametersUpdate,
queryProtocolState,
Expand Down

0 comments on commit 6b18972

Please sign in to comment.