Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete deprecated functions and types #230

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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