Skip to content

Commit

Permalink
Merge pull request #669 from IntersectMBO/smelc/disambiguate-text-bin…
Browse files Browse the repository at this point in the history
…ary-in-proposal-newtype

proposal: disambiguate binary data from text data
  • Loading branch information
smelc authored Mar 22, 2024
2 parents e37a31a + e48024b commit 6dc843c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data GovernanceHashAnchorDataCmdArgs era
} deriving Show

data GovernanceAnchorDataHashSource
= GovernanceAnchorDataHashSourceBinaryFile (File ProposalText In)
= GovernanceAnchorDataHashSourceBinaryFile (File ProposalBinary In)
| GovernanceAnchorDataHashSourceTextFile (File ProposalText In)
| GovernanceAnchorDataHashSourceText Text
deriving Show
Expand Down
6 changes: 6 additions & 0 deletions cardano-cli/src/Cardano/CLI/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module Cardano.CLI.Types.Common
, ParserFileDirection (..)
, IdOutputFormat (..)
, PrivKeyFile(..)
, ProposalBinary(..)
, ProposalFile
, ProposalText(..)
, ProposalUrl(..)
Expand Down Expand Up @@ -91,6 +92,7 @@ import qualified Cardano.Chain.Slotting as Byron

import Data.Aeson (FromJSON (..), ToJSON (..), object, pairs, (.=))
import qualified Data.Aeson as Aeson
import qualified Data.ByteString as BS
import Data.String (IsString)
import Data.Text (Text)
import qualified Data.Text as Text
Expand Down Expand Up @@ -122,6 +124,10 @@ newtype ProposalUrl = ProposalUrl
{ unProposalUrl :: L.Url
} deriving (Eq, Show)

newtype ProposalBinary = ProposalBinary
{ unProposalBinary :: BS.ByteString
} deriving (Eq, Show)

newtype ProposalText = ProposalText
{ unProposalText :: Text
} deriving (Eq, Show)
Expand Down

0 comments on commit 6dc843c

Please sign in to comment.