From 525b7d325367a896e89913dea634e5d2e8e38100 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Tue, 15 Oct 2024 15:26:00 +0200 Subject: [PATCH] Remove `_pcaAnchor` lens --- .../src/Cardano/CLI/EraBased/Run/Governance/Vote.hs | 8 ++++---- cardano-cli/src/Cardano/CLI/Types/Common.hs | 11 ----------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs index 9414bd577..b48c07366 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs @@ -27,7 +27,6 @@ import Cardano.CLI.Types.Key import Data.Aeson.Encode.Pretty import Data.Function import qualified Data.Yaml.Pretty as Yaml -import Lens.Micro (_Just, over) runGovernanceVoteCmds :: () @@ -57,9 +56,10 @@ runGovernanceVoteCreateCmd let (govActionTxId, govActionIndex) = governanceAction sbe = conwayEraOnwardsToShelleyBasedEra eon -- TODO: Conway era - update vote creation related function to take ConwayEraOnwards mAnchor' = - over - (_Just . _pcaAnchor) - (\(VoteUrl url, voteHash) -> L.Anchor{L.anchorUrl = url, L.anchorDataHash = voteHash}) + fmap + ( \pca@PotentiallyCheckedAnchor{pcaAnchor = (VoteUrl url, voteHash)} -> + pca{pcaAnchor = L.Anchor{L.anchorUrl = url, L.anchorDataHash = voteHash}} + ) mAnchor mapM_ diff --git a/cardano-cli/src/Cardano/CLI/Types/Common.hs b/cardano-cli/src/Cardano/CLI/Types/Common.hs index 32f9a1eaa..082fae131 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Common.hs @@ -90,7 +90,6 @@ module Cardano.CLI.Types.Common , DRepMetadataUrl , ResignationMetadataUrl , PotentiallyCheckedAnchor (..) - , _pcaAnchor ) where @@ -105,7 +104,6 @@ import Data.String (IsString) import Data.Text (Text) import qualified Data.Text as Text import Data.Word (Word64) -import Lens.Micro.Type (Traversal) -- | Determines the direction in which the MIR certificate will transfer ADA. data TransferDirection @@ -667,12 +665,3 @@ data PotentiallyCheckedAnchor anchorType anchor -- ^ Whether to check the hash or not (CheckHash for checking or TrustHash for not checking) } deriving (Eq, Show) - -_pcaAnchor - :: Traversal - (PotentiallyCheckedAnchor anchorType anchor) - (PotentiallyCheckedAnchor anchorType anchor') - anchor - anchor' -_pcaAnchor f pca@(PotentiallyCheckedAnchor{pcaAnchor = pcaAnchor'}) = - (\newAnchor -> pca{pcaAnchor = newAnchor}) <$> f pcaAnchor'