Skip to content

Commit

Permalink
Remove _pcaAnchor lens
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Oct 15, 2024
1 parent 2b53bcf commit 525b7d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
8 changes: 4 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
:: ()
Expand Down Expand Up @@ -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_
Expand Down
11 changes: 0 additions & 11 deletions cardano-cli/src/Cardano/CLI/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ module Cardano.CLI.Types.Common
, DRepMetadataUrl
, ResignationMetadataUrl
, PotentiallyCheckedAnchor (..)
, _pcaAnchor
)
where

Expand All @@ -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
Expand Down Expand Up @@ -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'

0 comments on commit 525b7d3

Please sign in to comment.