From 829bc782d024c4b4e3e4ac3d3568fe5b732802bf Mon Sep 17 00:00:00 2001 From: John Ky Date: Sat, 29 Jul 2023 00:11:43 +1000 Subject: [PATCH] Use AnyShelleyToBabbageEra from cardano-api instead --- cardano-cli/src/Cardano/CLI/Run/Legacy/StakeAddress.hs | 10 ++++------ cardano-cli/src/Cardano/CLI/Types/Governance.hs | 7 ------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/Run/Legacy/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/Run/Legacy/StakeAddress.hs index a35d470063..f140d91e78 100644 --- a/cardano-cli/src/Cardano/CLI/Run/Legacy/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/Run/Legacy/StakeAddress.hs @@ -24,7 +24,6 @@ import Cardano.Api.Shelley import Cardano.CLI.EraBased.Legacy import Cardano.CLI.Run.Legacy.Read -import Cardano.CLI.Types.Governance import Cardano.CLI.Types.Key (DelegationTarget (..), StakeIdentifier (..), StakeVerifier (..), VerificationKeyOrFile, readVerificationKeyOrFile, readVerificationKeyOrHashOrFile) @@ -237,8 +236,7 @@ createDelegationCertRequirements sbe stakeCred delegatee = return $ StakeDelegationRequirementsConwayOnwards ConwayEraOnwardsConway stakeCred delegatee onlySpoDelegatee - :: IsShelleyBasedEra era - => ShelleyToBabbageEra era + :: ShelleyToBabbageEra era -> Ledger.Delegatee (Ledger.EraCrypto (ShelleyLedgerEra era)) -> Either StakeAddressDelegationError PoolId onlySpoDelegatee w ledgerDelegatee = @@ -246,11 +244,11 @@ onlySpoDelegatee w ledgerDelegatee = Ledger.DelegStake stakePoolKeyHash -> Right $ StakePoolKeyHash $ shelleyToBabbageEraConstraints w stakePoolKeyHash Ledger.DelegVote{} -> - Left . VoteDelegationNotSupported $ AnyAtMostBabbageEra w + Left . VoteDelegationNotSupported $ AnyShelleyToBabbageEra w Ledger.DelegStakeVote{} -> - Left . VoteDelegationNotSupported $ AnyAtMostBabbageEra w + Left . VoteDelegationNotSupported $ AnyShelleyToBabbageEra w -newtype StakeAddressDelegationError = VoteDelegationNotSupported AnyAtMostBabbageEra deriving Show +newtype StakeAddressDelegationError = VoteDelegationNotSupported AnyShelleyToBabbageEra deriving Show runStakeCredentialDeRegistrationCert :: AnyShelleyBasedEra diff --git a/cardano-cli/src/Cardano/CLI/Types/Governance.hs b/cardano-cli/src/Cardano/CLI/Types/Governance.hs index 669c4d78dc..780a15d06d 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Governance.hs @@ -1,6 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} -{-# LANGUAGE StandaloneDeriving #-} module Cardano.CLI.Types.Governance where @@ -44,9 +43,3 @@ data VType = VCC -- committee | VDR -- drep | VSP -- spo deriving Show - - -data AnyAtMostBabbageEra where - AnyAtMostBabbageEra :: IsShelleyBasedEra era => ShelleyToBabbageEra era -> AnyAtMostBabbageEra - -deriving instance Show AnyAtMostBabbageEra