From e48024b2f9554a06e5fb595a16426a36e9d39925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Thu, 21 Mar 2024 15:44:21 +0100 Subject: [PATCH] Treat binary proposal as binary --- .../src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs | 2 +- cardano-cli/src/Cardano/CLI/Types/Common.hs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs index 31742d48fb..53634cba6f 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs @@ -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 diff --git a/cardano-cli/src/Cardano/CLI/Types/Common.hs b/cardano-cli/src/Cardano/CLI/Types/Common.hs index d801b77bf2..d78967fb9e 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Common.hs @@ -42,6 +42,7 @@ module Cardano.CLI.Types.Common , ParserFileDirection (..) , IdOutputFormat (..) , PrivKeyFile(..) + , ProposalBinary(..) , ProposalFile , ProposalText(..) , ProposalUrl(..) @@ -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 @@ -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)