Skip to content

Commit

Permalink
Delete dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Nov 13, 2023
1 parent e229bf4 commit 77b7edb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
17 changes: 0 additions & 17 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3174,23 +3174,6 @@ pAnchorUrl =
ProposalUrl
<$> pUrl "anchor-url" "Anchor URL"

pProposalHashSource :: Parser ProposalHashSource
pProposalHashSource =
asum
[ ProposalHashSourceText
<$> Opt.strOption
( mconcat
[ Opt.long "proposal-anchor-metadata"
, Opt.metavar "TEXT"
, Opt.help "Proposal anchor contents as UTF-8 encoded text."
]
)
, ProposalHashSourceFile
<$> pFileInDirection "proposal-anchor-metadata-file" "Proposal anchor contents as a text file."
, ProposalHashSourceHash
<$> pAnchorDataHash
]

pAnchorDataHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData)
pAnchorDataHash =
Opt.option readSafeHash $ mconcat
Expand Down
17 changes: 0 additions & 17 deletions cardano-cli/src/Cardano/CLI/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ module Cardano.CLI.Read
, VoteError (..)
, readTxGovernanceActions
, constitutionHashSourceToHash
, proposalHashSourceToHash
, readProposal

-- * FileOrPipe
Expand Down Expand Up @@ -853,22 +852,6 @@ constitutionHashSourceToHash constitutionHashSource = do
ConstitutionHashSourceHash h ->
pure h

proposalHashSourceToHash :: ()
=> ProposalHashSource
-> ExceptT ProposalError IO (Ledger.SafeHash Ledger.StandardCrypto Ledger.AnchorData)
proposalHashSourceToHash proposalHashSource = do
case proposalHashSource of
ProposalHashSourceFile fp -> do
cBs <- liftIO $ BS.readFile $ unFile fp
_utf8EncodedText <- firstExceptT ProposalNotUnicodeError . hoistEither $ Text.decodeUtf8' cBs
pure $ Ledger.hashAnchorData $ Ledger.AnchorData cBs

ProposalHashSourceText c -> do
pure $ Ledger.hashAnchorData $ Ledger.AnchorData $ Text.encodeUtf8 c

ProposalHashSourceHash h ->
pure h

-- Misc

readFileInAnyCardanoEra
Expand Down
7 changes: 0 additions & 7 deletions cardano-cli/src/Cardano/CLI/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ module Cardano.CLI.Types.Common
, IdOutputFormat (..)
, PrivKeyFile(..)
, ProposalFile
, ProposalHashSource(..)
, ProposalText(..)
, ProposalUrl(..)
, ProtocolParamsFile(..)
Expand Down Expand Up @@ -127,12 +126,6 @@ newtype ProposalText = ProposalText
{ unProposalText :: Text
} deriving (Eq, Show)

data ProposalHashSource
= ProposalHashSourceFile (File ProposalText In)
| ProposalHashSourceText Text
| ProposalHashSourceHash (L.SafeHash Crypto.StandardCrypto L.AnchorData)
deriving Show

newtype VoteUrl = VoteUrl
{ unVoteUrl :: L.Url
} deriving (Eq, Show)
Expand Down

0 comments on commit 77b7edb

Please sign in to comment.