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 #173

Merged
merged 1 commit into from
Aug 14, 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
24 changes: 0 additions & 24 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ module Cardano.Api.Certificate (
AsType(..),

-- * Internal functions
shelleyCertificateConstraints,
conwayCertificateConstraints,
filterUnRegCreds,
selectStakeCredential,
) where
Expand Down Expand Up @@ -853,25 +851,3 @@ fromShelleyPoolParams
fromShelleyDnsName :: Ledger.DnsName -> ByteString
fromShelleyDnsName = Text.encodeUtf8
. Ledger.dnsToText

shelleyCertificateConstraints
:: ShelleyToBabbageEra era
-> (( Ledger.ShelleyEraTxCert (ShelleyLedgerEra era)
, EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto
, Ledger.TxCert (ShelleyLedgerEra era) ~ Ledger.ShelleyTxCert (ShelleyLedgerEra era)
, IsShelleyBasedEra era
) => a)
-> a
shelleyCertificateConstraints w f = shelleyToBabbageEraConstraints w f {- HLINT ignore "Eta reduce" -}
{-# DEPRECATED shelleyCertificateConstraints "Please use 'shelleyToBabbageEraConstraints' instead." #-}

conwayCertificateConstraints
:: ConwayEraOnwards era
-> (( Ledger.ConwayEraTxCert (ShelleyLedgerEra era)
, EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto
, Ledger.TxCert (ShelleyLedgerEra era) ~ Ledger.ConwayTxCert (ShelleyLedgerEra era)
, IsShelleyBasedEra era
) => a)
-> a
conwayCertificateConstraints w f = conwayEraOnwardsConstraints w f {- HLINT ignore "Eta reduce" -}
{-# DEPRECATED conwayCertificateConstraints "Please use 'conwayEraOnwardsConstraints' instead." #-}
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ data TxGovernanceActions era where
deriving instance IsShelleyBasedEra era => Show (TxGovernanceActions era)
deriving instance IsShelleyBasedEra era => Eq (TxGovernanceActions era)


-- | A representation of whether the era supports transactions with governance
-- actions.
--
-- The Conway and subsequent eras support governance actions.
--
data TxGovernanceActionSupportedInEra era where

GovernanceActionsSupportedInConwayEra :: TxGovernanceActionSupportedInEra ConwayEra
{-# DEPRECATED TxGovernanceActionSupportedInEra "Use ConwayEraOnwards instead" #-}

deriving instance Show (TxGovernanceActionSupportedInEra era)
deriving instance Eq (TxGovernanceActionSupportedInEra era)

governanceActionsSupportedInEra :: ShelleyBasedEra era -> Maybe (TxGovernanceActionSupportedInEra era)
governanceActionsSupportedInEra ShelleyBasedEraShelley = Nothing
governanceActionsSupportedInEra ShelleyBasedEraAllegra = Nothing
governanceActionsSupportedInEra ShelleyBasedEraMary = Nothing
governanceActionsSupportedInEra ShelleyBasedEraAlonzo = Nothing
governanceActionsSupportedInEra ShelleyBasedEraBabbage = Nothing
governanceActionsSupportedInEra ShelleyBasedEraConway = Just GovernanceActionsSupportedInConwayEra
{-# DEPRECATED governanceActionsSupportedInEra "Use featureInShelleyBasedEra Nothing Just instead" #-}

data AnyGovernanceAction = forall era. AnyGovernanceAction (Gov.GovernanceAction era)

-- TODO: Conway - fill in remaining actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,6 @@ data TxVotes era where
deriving instance Show (TxVotes era)
deriving instance Eq (TxVotes era)


-- | A representation of whether the era supports transactions with votes.
--
-- The Conway and subsequent eras support governance actions.
--
data TxVotesSupportedInEra era where
VotesSupportedInConwayEra :: TxVotesSupportedInEra ConwayEra
{-# DEPRECATED TxVotesSupportedInEra "Use ConwayEraOnwards instead" #-}

deriving instance Show (TxVotesSupportedInEra era)
deriving instance Eq (TxVotesSupportedInEra era)

votesSupportedInEra :: ShelleyBasedEra era -> Maybe (TxVotesSupportedInEra era)
votesSupportedInEra ShelleyBasedEraShelley = Nothing
votesSupportedInEra ShelleyBasedEraAllegra = Nothing
votesSupportedInEra ShelleyBasedEraMary = Nothing
votesSupportedInEra ShelleyBasedEraAlonzo = Nothing
votesSupportedInEra ShelleyBasedEraBabbage = Nothing
votesSupportedInEra ShelleyBasedEraConway = Just VotesSupportedInConwayEra
{-# DEPRECATED votesSupportedInEra "Use conwayEraOnwardsConstraints instead" #-}

newtype GovernanceActionId ledgerera = GovernanceActionId
{ unGovernanceActionId :: Ledger.GovernanceActionId (EraCrypto ledgerera)
}
Expand Down
47 changes: 0 additions & 47 deletions cardano-api/internal/Cardano/Api/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,10 @@ module Cardano.Api.Utils

-- ** CLI option parsing
, bounded

-- ** Constraint solvers
, obtainCryptoConstraints
, obtainEraConstraints
, obtainEraPParamsConstraint
, obtainEraCryptoConstraints
, obtainSafeToHashConstraint
) where

import Cardano.Api.Eras

import Cardano.Crypto.Hash.Class (HashAlgorithm)
import Cardano.Ledger.Core (EraCrypto)
import qualified Cardano.Ledger.Core as Ledger
import Cardano.Ledger.Crypto (Crypto, StandardCrypto)
import qualified Cardano.Ledger.Crypto as Ledger
import Cardano.Ledger.Shelley ()

import Control.Exception (bracket)
Expand Down Expand Up @@ -145,38 +133,3 @@ bounded t = eitherReader $ \s -> do
when (i < fromIntegral (minBound @a)) $ Left $ t <> " must not be less than " <> show (minBound @a)
when (i > fromIntegral (maxBound @a)) $ Left $ t <> " must not greater than " <> show (maxBound @a)
pure (fromIntegral i)

obtainEraCryptoConstraints
:: ShelleyBasedEra era
-> ((EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto) => a)
-> a
obtainEraCryptoConstraints = shelleyBasedEraConstraints
{-# DEPRECATED obtainEraCryptoConstraints "Use shelleyBasedEraConstraints instead" #-}

obtainCryptoConstraints
:: ShelleyBasedEra era
-> ((Crypto (EraCrypto (ShelleyLedgerEra era))) => a)
-> a
obtainCryptoConstraints = shelleyBasedEraConstraints
{-# DEPRECATED obtainCryptoConstraints "Use shelleyBasedEraConstraints instead" #-}

obtainEraPParamsConstraint
:: ShelleyBasedEra era
-> (Ledger.EraPParams (ShelleyLedgerEra era) => a)
-> a
obtainEraPParamsConstraint = shelleyBasedEraConstraints
{-# DEPRECATED obtainEraPParamsConstraint "Use shelleyBasedEraConstraints instead" #-}

obtainEraConstraints
:: ShelleyLedgerEra era ~ ledgerera
=> ShelleyBasedEra era
-> ( (IsShelleyBasedEra era, Ledger.Era ledgerera) => a) -> a
obtainEraConstraints = shelleyBasedEraConstraints
{-# DEPRECATED obtainEraConstraints "Use shelleyBasedEraConstraints instead" #-}

obtainSafeToHashConstraint
:: ShelleyBasedEra era
-> (HashAlgorithm (Ledger.HASH (EraCrypto (ShelleyLedgerEra era))) => a)
-> a
obtainSafeToHashConstraint = shelleyBasedEraConstraints
{-# DEPRECATED obtainSafeToHashConstraint "Use shelleyBasedEraConstraints instead" #-}
4 changes: 0 additions & 4 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ module Cardano.Api (
CertificatesSupportedInEra(..),
UpdateProposalSupportedInEra(..),
TxTotalAndReturnCollateralSupportedInEra(..),
TxVotesSupportedInEra(..),
TxGovernanceActionSupportedInEra(..),

-- ** Feature availability functions
collateralSupportedInEra,
Expand All @@ -328,8 +326,6 @@ module Cardano.Api (
updateProposalSupportedInEra,
scriptDataSupportedInEra,
totalAndReturnCollateralSupportedInEra,
votesSupportedInEra,
governanceActionsSupportedInEra,

-- ** Era-dependent protocol features
ProtocolUTxOCostPerByteFeature(..),
Expand Down
9 changes: 0 additions & 9 deletions cardano-api/src/Cardano/Api/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,9 @@ module Cardano.Api.Shelley
-- TODO: arrange not to export these
toLedgerNonce,
toShelleyNetwork,
obtainCryptoConstraints,
obtainEraConstraints,
obtainEraPParamsConstraint,
obtainEraCryptoConstraints,
fromShelleyPoolParams,
fromLedgerPParamsUpdate,

-- Era based
shelleyCertificateConstraints,
conwayCertificateConstraints,

) where

import Cardano.Api
Expand Down Expand Up @@ -317,5 +309,4 @@ import Cardano.Api.StakePoolMetadata
import Cardano.Api.Tx
import Cardano.Api.TxBody
import Cardano.Api.TxMetadata
import Cardano.Api.Utils
import Cardano.Api.Value