diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 0129180c78..6f7a689379 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -74,6 +74,7 @@ library Cardano.CLI.EraBased.Commands.Governance.Actions Cardano.CLI.EraBased.Commands.Governance.Committee Cardano.CLI.EraBased.Commands.Governance.DRep + Cardano.CLI.EraBased.Commands.Governance.Hash Cardano.CLI.EraBased.Commands.Governance.Poll Cardano.CLI.EraBased.Commands.Governance.Vote Cardano.CLI.EraBased.Commands.Key @@ -90,6 +91,7 @@ library Cardano.CLI.EraBased.Options.Governance.Actions Cardano.CLI.EraBased.Options.Governance.Committee Cardano.CLI.EraBased.Options.Governance.DRep + Cardano.CLI.EraBased.Options.Governance.Hash Cardano.CLI.EraBased.Options.Governance.Poll Cardano.CLI.EraBased.Options.Governance.Vote Cardano.CLI.EraBased.Options.Key @@ -107,6 +109,7 @@ library Cardano.CLI.EraBased.Run.Governance.Actions Cardano.CLI.EraBased.Run.Governance.Committee Cardano.CLI.EraBased.Run.Governance.DRep + Cardano.CLI.EraBased.Run.Governance.Hash Cardano.CLI.EraBased.Run.Governance.GenesisKeyDelegationCertificate Cardano.CLI.EraBased.Run.Governance.Poll Cardano.CLI.EraBased.Run.Governance.Vote @@ -165,6 +168,7 @@ library Cardano.CLI.Types.Errors.GovernanceActionsError Cardano.CLI.Types.Errors.GovernanceCmdError Cardano.CLI.Types.Errors.GovernanceCommitteeError + Cardano.CLI.Types.Errors.GovernanceHashError Cardano.CLI.Types.Errors.GovernanceQueryError Cardano.CLI.Types.Errors.GovernanceVoteCmdError Cardano.CLI.Types.Errors.ItnKeyConversionError diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs index 7452918f85..05f8a02645 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance.hs @@ -13,6 +13,7 @@ import Cardano.Api.Shelley (VrfKey) import Cardano.CLI.EraBased.Commands.Governance.Actions import Cardano.CLI.EraBased.Commands.Governance.Committee import Cardano.CLI.EraBased.Commands.Governance.DRep +import Cardano.CLI.EraBased.Commands.Governance.Hash import Cardano.CLI.EraBased.Commands.Governance.Poll import Cardano.CLI.EraBased.Commands.Governance.Vote import Cardano.CLI.Types.Key (VerificationKeyOrHashOrFile) @@ -46,6 +47,8 @@ data GovernanceCmds era (GovernanceCommitteeCmds era) | GovernanceDRepCmds (GovernanceDRepCmds era) + | GovernanceHashCmds + (GovernanceHashCmds era) | GovernancePollCmds (GovernancePollCmds era) | GovernanceVoteCmds @@ -67,6 +70,8 @@ renderGovernanceCmds = \case renderGovernanceCommitteeCmds cmds GovernanceDRepCmds cmds -> renderGovernanceDRepCmds cmds + GovernanceHashCmds cmds -> + renderGovernanceHashCmds cmds GovernancePollCmds cmds -> renderGovernancePollCmds cmds GovernanceVoteCmds cmds -> diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs index ce152623a7..e5b93d1d76 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs @@ -26,6 +26,9 @@ import Cardano.Api.Shelley import Cardano.CLI.Types.Common import Cardano.CLI.Types.Key +import qualified Cardano.Ledger.BaseTypes as Ledger +import qualified Cardano.Ledger.Crypto as Crypto +import qualified Cardano.Ledger.SafeHash as Ledger import Data.Text (Text) import Data.Word @@ -47,7 +50,7 @@ data GoveranceActionUpdateCommitteeCmdArgs era , deposit :: !Lovelace , returnAddress :: !(VerificationKeyOrHashOrFile StakeKey) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , oldCommitteeVkeySource :: ![VerificationKeyOrHashOrFile CommitteeColdKey] , newCommitteeVkeySource :: ![(VerificationKeyOrHashOrFile CommitteeColdKey, EpochNo)] , requiredQuorum :: !Rational @@ -63,7 +66,7 @@ data GovernanceActionCreateConstitutionCmdArgs era , stakeCredential :: !(VerificationKeyOrHashOrFile StakeKey) , mPrevGovernanceActionId :: !(Maybe (TxId, Word32)) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , constitutionUrl :: !ConstitutionUrl , constitutionHashSource :: !ConstitutionHashSource , outFile :: !(File () Out) @@ -77,7 +80,7 @@ data GovernanceActionInfoCmdArgs era , deposit :: !Lovelace , returnStakeAddress :: !(VerificationKeyOrHashOrFile StakeKey) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , outFile :: !(File () Out) } deriving Show @@ -88,7 +91,7 @@ data GovernanceActionCreateNoConfidenceCmdArgs era , deposit :: !Lovelace , returnStakeAddress :: !(VerificationKeyOrHashOrFile StakeKey) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , governanceActionId :: !TxId , governanceActionIndex :: !Word32 , outFile :: !(File () Out) @@ -110,7 +113,7 @@ data GovernanceActionTreasuryWithdrawalCmdArgs era , deposit :: !Lovelace , returnAddr :: !(VerificationKeyOrHashOrFile StakeKey) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , treasuryWithdrawal :: ![(VerificationKeyOrHashOrFile StakeKey, Lovelace)] , outFile :: !(File () Out) } deriving Show @@ -130,7 +133,7 @@ data UpdateProtocolParametersConwayOnwards era , deposit :: !Lovelace , returnAddr :: !(VerificationKeyOrHashOrFile StakeKey) , proposalUrl :: !ProposalUrl - , proposalHashSource :: !ProposalHashSource + , proposalHash :: !(Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , governanceActionId :: !(Maybe (TxId, Word32)) } diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs new file mode 100644 index 0000000000..17c5b3bf67 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Hash.hs @@ -0,0 +1,35 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE LambdaCase #-} + + +module Cardano.CLI.EraBased.Commands.Governance.Hash + ( + GovernanceHashCmds (..), + GovernanceHashCmdArgs (..), + GovernanceHashSource (..), + renderGovernanceHashCmds + ) where + +import Cardano.Api + +import Cardano.CLI.Types.Common + +import Data.Text (Text) + +newtype GovernanceHashCmds era = GovernanceHashCmd (GovernanceHashCmdArgs era) + +data GovernanceHashCmdArgs era + = GovernanceHashCmdArgs { + eon :: !(ConwayEraOnwards era), + toHash :: !GovernanceHashSource + } deriving Show + +data GovernanceHashSource + = GovernanceHashSourceBinaryFile (File ProposalText In) + | GovernanceHashSourceTextFile (File ProposalText In) + | GovernanceHashSourceText Text + deriving Show + +renderGovernanceHashCmds :: GovernanceHashCmds era -> Text +renderGovernanceHashCmds = + \case GovernanceHashCmd {} -> "governance hash" diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Vote.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Vote.hs index a959ce71ec..0cb4f30146 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Vote.hs @@ -9,11 +9,13 @@ module Cardano.CLI.EraBased.Commands.Governance.Vote , GovernanceVoteCreateCmdArgs(..) , renderGovernanceVoteCmds ) where - import Cardano.Api.Shelley import Cardano.CLI.Types.Common import Cardano.CLI.Types.Governance +import qualified Cardano.Ledger.BaseTypes as Ledger +import qualified Cardano.Ledger.Crypto as Crypto +import qualified Cardano.Ledger.SafeHash as Ledger import Data.Text (Text) import Data.Word @@ -30,7 +32,7 @@ data GovernanceVoteCreateCmdArgs era , voteChoice :: Vote , governanceAction :: (TxId, Word32) , votingStakeCredentialSource :: AnyVotingStakeVerificationKeyOrHashOrFile - , mAnchor :: Maybe (VoteUrl, VoteHashSource) + , mAnchor :: Maybe (VoteUrl, Ledger.SafeHash Crypto.StandardCrypto Ledger.AnchorData) , outFile :: VoteFile Out } diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs index be8a3a1a2c..55de5b44d0 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Common.hs @@ -3046,34 +3046,17 @@ pAlwaysAbstain = , Opt.help "Abstain from voting on all proposals." ] -pVoteAnchor :: Parser (VoteUrl, VoteHashSource) +pVoteAnchor :: Parser (VoteUrl, L.SafeHash Crypto.StandardCrypto L.AnchorData) pVoteAnchor = (,) - <$> (VoteUrl <$> pUrl "vote-anchor-url" "Vote anchor URL") - <*> pVoteHashSource + <$> (VoteUrl <$> pUrl "anchor-url" "Vote anchor URL") + <*> pVoteAnchorDataHash -pVoteHashSource :: Parser VoteHashSource -pVoteHashSource = - asum - [ VoteHashSourceText - <$> Opt.strOption - ( mconcat - [ Opt.long "vote-anchor-metadata" - , Opt.metavar "TEXT" - , Opt.help "Vote anchor contents as UTF-8 encoded text." - ] - ) - , VoteHashSourceFile - <$> pFileInDirection "vote-anchor-metadata-file" "Vote anchor contents as a text file." - , VoteHashSourceHash - <$> pVoteHash - ] - -pVoteHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData) -pVoteHash = +pVoteAnchorDataHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData) +pVoteAnchorDataHash = Opt.option readSafeHash $ mconcat - [ Opt.long "vote-anchor-metadata-hash" + [ Opt.long "anchor-data-hash" , Opt.metavar "HASH" - , Opt.help "Hash of the vote anchor data." + , Opt.help "Hash of the vote anchor data (obtain it with \"cardano-cli conway governance hash ...\")." ] pAlwaysNoConfidence :: Parser () @@ -3186,34 +3169,17 @@ pDRepVerificationKeyFile = , Opt.completer (Opt.bashCompleter "file") ] -pProposalUrl :: Parser ProposalUrl -pProposalUrl = +pAnchorUrl :: Parser ProposalUrl +pAnchorUrl = ProposalUrl - <$> pUrl "proposal-anchor-url" "Proposal 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 - <$> pProposalHash - ] + <$> pUrl "anchor-url" "Anchor URL" -pProposalHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData) -pProposalHash = +pAnchorDataHash :: Parser (L.SafeHash Crypto.StandardCrypto L.AnchorData) +pAnchorDataHash = Opt.option readSafeHash $ mconcat - [ Opt.long "proposal-anchor-metadata-hash" + [ Opt.long "anchor-data-hash" , Opt.metavar "HASH" - , Opt.help "Proposal anchor data hash." + , Opt.help "Proposal anchor data hash (obtain it with \"cardano-cli conway governance hash ...\")" ] pPreviousGovernanceAction :: Parser (Maybe (TxId, Word32)) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance.hs index 9ede4ecc02..6b75ba14c8 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance.hs @@ -14,6 +14,7 @@ import Cardano.CLI.EraBased.Options.Common import Cardano.CLI.EraBased.Options.Governance.Actions import Cardano.CLI.EraBased.Options.Governance.Committee import Cardano.CLI.EraBased.Options.Governance.DRep +import Cardano.CLI.EraBased.Options.Governance.Hash import Cardano.CLI.EraBased.Options.Governance.Poll import Cardano.CLI.EraBased.Options.Governance.Vote @@ -36,6 +37,7 @@ pGovernanceCmds era = , fmap GovernanceActionCmds <$> pGovernanceActionCmds era , fmap GovernanceCommitteeCmds <$> pGovernanceCommitteeCmds era , fmap GovernanceDRepCmds <$> pGovernanceDRepCmds era + , fmap GovernanceHashCmds <$> pGovernanceHashCmds era , fmap GovernancePollCmds <$> pGovernancePollCmds era , fmap GovernanceVoteCmds <$> pGovernanceVoteCmds era ] diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs index 614c6035ad..e67f2a126d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -69,8 +69,8 @@ pGovernanceActionNewInfoCmd era = do <$> pNetwork <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile Nothing - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> pFileOutDirection "out-file" "Path to action file to be used later on with build or build-raw " ) $ Opt.progDesc "Create an info action." @@ -90,8 +90,8 @@ pGovernanceActionNewConstitutionCmd era = do <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile Nothing <*> pPreviousGovernanceAction - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> pConstitutionUrl <*> pConstitutionHashSource <*> pFileOutDirection "out-file" "Output filepath of the constitution." @@ -119,8 +119,8 @@ pUpdateCommitteeCmd eon = <$> pNetwork <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile Nothing - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> many pRemoveCommitteeColdVerificationKeyOrHashOrFile <*> many ( (,) @@ -144,8 +144,8 @@ pGovernanceActionNoConfidenceCmd era = do <$> pNetwork <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile Nothing - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> pTxId "governance-action-tx-id" "Previous txid of `NoConfidence` or `NewCommittee` governance action." <*> pWord32 "governance-action-index" "Previous tx's governance action index of `NoConfidence` or `NewCommittee` governance action." <*> pFileOutDirection "out-file" "Output filepath of the no confidence proposal." @@ -164,8 +164,8 @@ pUpdateProtocolParametersPostConway conwayOnwards = <$> pNetwork <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile Nothing - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> pPreviousGovernanceAction @@ -342,8 +342,8 @@ pGovernanceActionTreasuryWithdrawalCmd era = do <$> pNetwork <*> pGovActionDeposit <*> pStakeVerificationKeyOrHashOrFile (Just "deposit-return") - <*> pProposalUrl - <*> pProposalHashSource + <*> pAnchorUrl + <*> pAnchorDataHash <*> many ((,) <$> pStakeVerificationKeyOrHashOrFile (Just "funds-receiving") <*> pTransferAmt) <*> pFileOutDirection "out-file" "Output filepath of the treasury withdrawal." ) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Committee.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Committee.hs index e20d828933..cc56db0a11 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Committee.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Committee.hs @@ -8,7 +8,7 @@ module Cardano.CLI.EraBased.Options.Governance.Committee import Cardano.Api import Cardano.CLI.EraBased.Commands.Governance.Committee -import Cardano.CLI.EraBased.Options.Common +import Cardano.CLI.EraBased.Options.Common hiding (pAnchorUrl) import Cardano.CLI.Read import qualified Cardano.Ledger.BaseTypes as L import qualified Cardano.Ledger.Crypto as Crypto diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Hash.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Hash.hs new file mode 100644 index 0000000000..4a0ae4736c --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Hash.hs @@ -0,0 +1,49 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} + +module Cardano.CLI.EraBased.Options.Governance.Hash + ( + pGovernanceHashCmds + ) where + +import Cardano.Api + +import Cardano.CLI.EraBased.Commands.Governance.Hash + (GovernanceHashCmdArgs (GovernanceHashCmdArgs)) +import qualified Cardano.CLI.EraBased.Commands.Governance.Hash as Cmd +import Cardano.CLI.EraBased.Options.Common + +import Data.Foldable +import Options.Applicative +import qualified Options.Applicative as Opt + +pGovernanceHashCmds :: () + => CardanoEra era + -> Maybe (Parser (Cmd.GovernanceHashCmds era)) +pGovernanceHashCmds era = do + eon <- forEraMaybeEon era + return + $ subParser "hash" + $ Opt.info + ( Cmd.GovernanceHashCmd . GovernanceHashCmdArgs eon + <$> pGovernanceHashSource + ) + $ Opt.progDesc "Compute the hash to pass to the various --*-hash arguments of governance commands." + +pGovernanceHashSource :: Parser Cmd.GovernanceHashSource +pGovernanceHashSource = + asum + [ + Cmd.GovernanceHashSourceText + <$> Opt.strOption + ( mconcat + [ Opt.long "text" + , Opt.metavar "TEXT" + , Opt.help "Text to hash as UTF-8" + ] + ) + , Cmd.GovernanceHashSourceBinaryFile + <$> pFileInDirection "file-binary" "Binary file to hash" + , Cmd.GovernanceHashSourceTextFile + <$> pFileInDirection "file-text" "Text file to hash" + ] diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs index 07ebf622ef..a22e50e416 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance.hs @@ -24,6 +24,7 @@ import Cardano.CLI.EraBased.Run.Governance.Actions import Cardano.CLI.EraBased.Run.Governance.Committee import Cardano.CLI.EraBased.Run.Governance.DRep import Cardano.CLI.EraBased.Run.Governance.GenesisKeyDelegationCertificate +import Cardano.CLI.EraBased.Run.Governance.Hash import Cardano.CLI.EraBased.Run.Governance.Poll import Cardano.CLI.EraBased.Run.Governance.Vote import Cardano.CLI.Types.Errors.CmdError @@ -67,6 +68,9 @@ runGovernanceCmds = \case Cmd.GovernanceDRepCmds cmds -> runGovernanceDRepCmds cmds + Cmd.GovernanceHashCmds cmds -> + runGovernanceHashCmds cmds + Cmd.GovernancePollCmds cmds -> runGovernancePollCmds cmds & firstExceptT CmdGovernanceCmdError diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs index 509ff8bb3d..7ac56b078b 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -84,15 +84,11 @@ runGovernanceActionInfoCmd , Cmd.deposit , Cmd.returnStakeAddress , Cmd.proposalUrl - , Cmd.proposalHashSource + , Cmd.proposalHash , Cmd.outFile } = do returnKeyHash <- readStakeKeyHash returnStakeAddress - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash @@ -117,17 +113,13 @@ runGovernanceActionCreateNoConfidenceCmd , Cmd.deposit , Cmd.returnStakeAddress , Cmd.proposalUrl - , Cmd.proposalHashSource + , Cmd.proposalHash , Cmd.governanceActionId , Cmd.governanceActionIndex , Cmd.outFile } = do returnKeyHash <- readStakeKeyHash returnStakeAddress - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash @@ -152,7 +144,7 @@ runGovernanceActionCreateConstitutionCmd , Cmd.stakeCredential , Cmd.mPrevGovernanceActionId , Cmd.proposalUrl - , Cmd.proposalHashSource + , Cmd.proposalHash , Cmd.constitutionUrl , Cmd.constitutionHashSource , Cmd.outFile @@ -160,10 +152,6 @@ runGovernanceActionCreateConstitutionCmd stakeKeyHash <- readStakeKeyHash stakeCredential - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash @@ -198,7 +186,7 @@ runGovernanceActionCreateNewCommitteeCmd , Cmd.deposit , Cmd.returnAddress , Cmd.proposalUrl - , Cmd.proposalHashSource + , Cmd.proposalHash , Cmd.oldCommitteeVkeySource , Cmd.newCommitteeVkeySource , Cmd.requiredQuorum @@ -210,10 +198,6 @@ runGovernanceActionCreateNewCommitteeCmd uncurry createPreviousGovernanceActionId <$> mPrevGovernanceActionId quorumRational = toRational requiredQuorum - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash @@ -271,16 +255,12 @@ runGovernanceActionCreateProtocolParametersUpdateCmd eraBasedPParams' = do anyEra = AnyShelleyBasedEra $ conwayEraOnwardsToShelleyBasedEra conwayOnwards UpdateProtocolParametersConwayOnwards _cOnwards network deposit returnAddr proposalUrl - proposalHashSource mPrevGovActId + proposalHash mPrevGovActId <- hoistMaybe (GovernanceActionsValueUpdateProtocolParametersNotFound anyEra) $ uppConwayOnwards eraBasedPParams' returnKeyHash <- readStakeKeyHash returnAddr - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let eraBasedPParams = uppNewPParams eraBasedPParams' updateProtocolParams = createEraBasedProtocolParamUpdate sbe eraBasedPParams @@ -315,15 +295,11 @@ runGovernanceActionTreasuryWithdrawalCmd , Cmd.deposit , Cmd.returnAddr , Cmd.proposalUrl - , Cmd.proposalHashSource + , Cmd.proposalHash , Cmd.treasuryWithdrawal , Cmd.outFile } = do - proposalHash <- - proposalHashSourceToHash proposalHashSource - & firstExceptT GovernanceActionsCmdProposalError - let proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs new file mode 100644 index 0000000000..61298f390d --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Hash.hs @@ -0,0 +1,65 @@ + +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +{- HLINT ignore "Use let" -} + +module Cardano.CLI.EraBased.Run.Governance.Hash + ( runGovernanceHashCmds + ) where + +import Cardano.Api + +import qualified Cardano.CLI.EraBased.Commands.Governance.Hash as Cmd +import Cardano.CLI.Types.Errors.CmdError +import Cardano.CLI.Types.Errors.GovernanceCmdError +import Cardano.CLI.Types.Errors.GovernanceHashError +import Cardano.Crypto.Hash (hashToTextAsHex) +import qualified Cardano.Ledger.BaseTypes as Ledger +import Cardano.Ledger.Crypto +import Cardano.Ledger.SafeHash (extractHash) +import qualified Cardano.Ledger.SafeHash as Ledger + +import Control.Monad.IO.Class +import Control.Monad.Trans.Except +import Control.Monad.Trans.Except.Extra +import qualified Data.ByteString as BS +import Data.Function +import qualified Data.Text as Text +import qualified Data.Text.Encoding as Text +import qualified Data.Text.IO as Text + +runGovernanceHashCmds :: () + => Cmd.GovernanceHashCmds era + -> ExceptT CmdError IO () +runGovernanceHashCmds (Cmd.GovernanceHashCmd args)= + runGovernanceHashCmd args + & firstExceptT (CmdGovernanceCmdError . GovernanceCmdHashError) + +runGovernanceHashCmd :: () + => Cmd.GovernanceHashCmdArgs era + -> ExceptT GovernanceHashError IO () +runGovernanceHashCmd Cmd.GovernanceHashCmdArgs { toHash } = + -- TODO @smelc we probably want an option to write the computed hash to a file + -- This can be done in a separate PR + case toHash of + Cmd.GovernanceHashSourceBinaryFile fp -> do + let path = unFile fp + bytes <- handleIOExceptT (GovernanceHashReadFileError path) $ BS.readFile path + let hash = Ledger.hashAnchorData $ Ledger.AnchorData bytes + printHash hash + Cmd.GovernanceHashSourceTextFile fp -> do + let path = unFile fp + text <- handleIOExceptT (GovernanceHashReadFileError path) $ Text.readFile path + let hash = Ledger.hashAnchorData $ Ledger.AnchorData $ Text.encodeUtf8 text + printHash hash + Cmd.GovernanceHashSourceText text -> do + let hash = Ledger.hashAnchorData $ Ledger.AnchorData $ Text.encodeUtf8 text + printHash hash + where + printHash :: Ledger.SafeHash StandardCrypto i -> ExceptT a IO () + printHash = liftIO . putStr . Text.unpack . hashToTextAsHex . extractHash 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 11bfddbddd..3ea542d1bf 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Vote.hs @@ -15,7 +15,7 @@ import qualified Cardano.Api.Ledger as Ledger import Cardano.Api.Shelley import qualified Cardano.CLI.EraBased.Commands.Governance.Vote as Cmd -import Cardano.CLI.Read (readVoteHashSource, readVotingProceduresFile) +import Cardano.CLI.Read (readVotingProceduresFile) import Cardano.CLI.Types.Common import Cardano.CLI.Types.Errors.CmdError import Cardano.CLI.Types.Errors.GovernanceVoteCmdError @@ -55,8 +55,7 @@ runGovernanceVoteCreateCmd let sbe = conwayEraOnwardsToShelleyBasedEra eon -- TODO: Conway era - update vote creation related function to take ConwayEraOnwards voteProcedure <- case mAnchor of Nothing -> pure $ createVotingProcedure eon voteChoice Nothing - Just (VoteUrl url, voteHashSource) -> shelleyBasedEraConstraints sbe $ do - voteHash <- firstExceptT GovernanceVoteCmdReadVoteTextError $ readVoteHashSource voteHashSource + Just (VoteUrl url, voteHash) -> shelleyBasedEraConstraints sbe $ do let voteAnchor = Ledger.Anchor { Ledger.anchorUrl = url, Ledger.anchorDataHash = voteHash } VotingProcedure votingProcedureWithoutAnchor = createVotingProcedure eon voteChoice Nothing votingProcedureWithAnchor = VotingProcedure $ votingProcedureWithoutAnchor { Ledger.vProcAnchor = Ledger.SJust voteAnchor } diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 19113f3184..8c41b071f7 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -58,7 +58,6 @@ module Cardano.CLI.Read , VoteError (..) , readTxGovernanceActions , constitutionHashSourceToHash - , proposalHashSourceToHash , readProposal -- * FileOrPipe @@ -94,7 +93,6 @@ module Cardano.CLI.Read -- * Vote related , readVoteDelegationTarget - , readVoteHashSource ) where import Cardano.Api as Api @@ -144,7 +142,7 @@ import qualified Data.Text as Text import qualified Data.Text.Encoding as Text import qualified Data.Text.Encoding.Error as Text import Data.Word -import GHC.IO.Handle (hClose, hIsSeekable,) +import GHC.IO.Handle (hClose, hIsSeekable) import GHC.IO.Handle.FD (openFileBlocking) import qualified Options.Applicative as Opt import System.IO (IOMode (ReadMode)) @@ -809,17 +807,6 @@ readVotingProceduresFile w fp = conwayEraOnwardsConstraints w $ first VoteErrorFile <$> readFileTextEnvelope AsVotingProcedures fp -readVoteHashSource :: () - => VoteHashSource - -> ExceptT VoteError IO (Ledger.SafeHash Ledger.StandardCrypto Ledger.AnchorData) -readVoteHashSource = \case - VoteHashSourceHash h -> return h - VoteHashSourceText c -> return $ Ledger.hashAnchorData $ Ledger.AnchorData $ Text.encodeUtf8 c - VoteHashSourceFile fp -> do - cBs <- firstExceptT VoteErrorFile . newExceptT $ readByteStringFile fp - _utf8EncodedText <- firstExceptT VoteErrorTextNotUnicode . hoistEither $ Text.decodeUtf8' cBs - return $ Ledger.hashAnchorData $ Ledger.AnchorData cBs - data ConstitutionError = ConstitutionErrorFile (FileError TextEnvelopeError) | ConstitutionNotSupportedInEra AnyCardanoEra @@ -865,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 diff --git a/cardano-cli/src/Cardano/CLI/Types/Common.hs b/cardano-cli/src/Cardano/CLI/Types/Common.hs index abe4d049fd..2dba412520 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Common.hs @@ -42,7 +42,6 @@ module Cardano.CLI.Types.Common , IdOutputFormat (..) , PrivKeyFile(..) , ProposalFile - , ProposalHashSource(..) , ProposalText(..) , ProposalUrl(..) , ProtocolParamsFile(..) @@ -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) diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs index f903c62465..07d3878e62 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceCmdError.hs @@ -9,6 +9,7 @@ import Cardano.Api.Shelley import Cardano.Binary (DecoderError) import Cardano.CLI.Read +import Cardano.CLI.Types.Errors.GovernanceHashError (GovernanceHashError) import Cardano.CLI.Types.Errors.StakeAddressCmdError import qualified Data.List as List @@ -26,6 +27,7 @@ data GovernanceCmdError | ReadFileError (FileError InputDecodeError) -- Governance action related | GovernanceCmdConstitutionError ConstitutionError + | GovernanceCmdHashError !GovernanceHashError | GovernanceCmdProposalError ProposalError | GovernanceCmdTextEnvReadError !(FileError TextEnvelopeError) | GovernanceCmdCddlError !CddlError @@ -69,6 +71,8 @@ instance Error GovernanceCmdError where displayError fileError GovernanceCmdConstitutionError e -> "Constitution error " <> show e -- TODO Conway render this properly + GovernanceCmdHashError e -> + "Hash error " <> displayError e GovernanceCmdProposalError e -> "Proposal error " <> show e -- TODO Conway render this properly GovernanceCmdTextEnvReadError fileError -> diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs new file mode 100644 index 0000000000..914ad52dd9 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceHashError.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE LambdaCase #-} +module Cardano.CLI.Types.Errors.GovernanceHashError + ( GovernanceHashError(..) + ) where + +import Cardano.Api + +import Cardano.Prelude (Exception (displayException), IOException) + +data GovernanceHashError + = GovernanceHashReadFileError FilePath IOException + deriving Show + +instance Error GovernanceHashError where + displayError = \case + GovernanceHashReadFileError filepath exc -> + "Cannot read " <> filepath <> ": " <> displayException exc diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs index 50295c69a7..d99d27b65a 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Action.hs @@ -26,11 +26,15 @@ hprop_golden_governance_action_create_constitution = actionFile <- noteTempFile tempDir "create-constitution.action" redactedActionFile <- noteTempFile tempDir "create-constitution.action.redacted" + proposalHash <- execCardanoCLI + [ "conway", "governance", "hash" + , "--text", "whatever "] + void $ execCardanoCLI [ "conway", "governance", "action", "create-constitution" , "--mainnet" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" - , "--proposal-anchor-url", "proposal-dummy-url" + , "--anchor-data-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" + , "--anchor-url", proposalHash , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--out-file", actionFile @@ -52,11 +56,15 @@ hprop_golden_conway_governance_action_view_constitution_json = actionFile <- noteTempFile tempDir "action" + proposalHash <- execCardanoCLI + [ "conway", "governance", "hash" + , "--text", "whatever "] + void $ execCardanoCLI [ "conway", "governance", "action", "create-constitution" , "--mainnet" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" - , "--proposal-anchor-url", "proposal-dummy-url" + , "--anchor-data-hash", proposalHash + , "--anchor-url", "proposal-dummy-url" , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile , "--out-file", actionFile @@ -83,8 +91,8 @@ hprop_golden_conway_governance_action_view_update_committee_yaml = , "--mainnet" , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile - , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--anchor-url", "proposal-dummy-url" + , "--anchor-data-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--quorum", "0.61" , "--out-file", actionFile ] @@ -109,8 +117,8 @@ hprop_golden_conway_governance_action_view_create_info_json_outfile = , "--testnet" , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile - , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--anchor-url", "proposal-dummy-url" + , "--anchor-data-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--out-file", actionFile ] @@ -135,8 +143,8 @@ hprop_golden_governanceActionCreateNoConfidence = , "--mainnet" , "--governance-action-deposit", "10" , "--stake-verification-key-file", stakeAddressVKeyFile - , "--proposal-anchor-url", "proposal-dummy-url" - , "--proposal-anchor-metadata", "eda258650888d4a7f8ac1127cfa136962f527f341c99db49929c79ae" + , "--anchor-url", "proposal-dummy-url" + , "--anchor-data-hash", "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745" , "--governance-action-index", "5" , "--governance-action-tx-id", "b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a" , "--out-file", actionFile diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs index 722517b6ae..6a34e5a89b 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Committee.hs @@ -13,6 +13,7 @@ import Hedgehog (Property) import qualified Hedgehog as H import qualified Hedgehog.Extras.Test.Base as H import qualified Hedgehog.Extras.Test.File as H +import qualified Hedgehog.Extras.Test.Golden as H hprop_golden_governanceCommitteeKeyGenCold :: Property hprop_golden_governanceCommitteeKeyGenCold = @@ -145,3 +146,38 @@ hprop_golden_governanceCommitteeCreateColdKeyResignationCertificate = H.assertFileOccurences 1 "CertificateShelley" certFile H.assertFileOccurences 1 "Constitutional Committee Cold Key Resignation Certificate" certFile + +hprop_golden_governanceUpdateCommittee :: Property +hprop_golden_governanceUpdateCommittee = + propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + stakeVkey <- noteInputFile "test/cardano-cli-golden/files/input/governance/stake-address.vkey" + ccProposal <- noteInputFile "test/cardano-cli-golden/files/input/governance/committee/cc-proposal.txt" + coldCCVkey1 <- noteInputFile "test/cardano-cli-golden/files/input/governance/committee/cc-cold1.vkey" + coldCCVkey2 <- noteInputFile "test/cardano-cli-golden/files/input/governance/committee/cc-cold2.vkey" + + outFile <- H.noteTempFile tempDir "answer-file.json" + + proposalHash <- execCardanoCLI + [ "conway", "governance", "hash" + , "--file-text", ccProposal ] + + H.note_ proposalHash + H.note_ $ show $ length proposalHash + + goldenAnswerFile <- H.note "test/cardano-cli-golden/files/golden/governance/committee/update-committee-answer.json" + + void $ execCardanoCLI + [ "conway", "governance", "action", "update-committee" + , "--testnet", "--governance-action-deposit", "0" + , "--stake-verification-key-file", stakeVkey + , "--anchor-url", "http://dummy" + , "--anchor-data-hash", proposalHash + , "--add-cc-cold-verification-key-file", coldCCVkey1 + , "--epoch", "202" + , "--add-cc-cold-verification-key-file", coldCCVkey2 + , "--epoch", "252" + , "--quorum", "51/100" + , "--out-file", outFile + ] + + H.diffFileVsGoldenFile outFile goldenAnswerFile diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs index a4ea9ce7f8..8af863477f 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Governance/Vote.hs @@ -24,8 +24,8 @@ hprop_golden_governance_governance_vote_create = , "--governance-action-index", "5" , "--drep-verification-key-file", vkeyFile , "--out-file", voteFile - , "--vote-anchor-url", "https://example.com/vote" - , "--vote-anchor-metadata", "I don't like this proposal, because it's bad. I'm not going to tell you why I voted yes nonetheless." + , "--anchor-url", "https://example.com/vote" + , "--anchor-data-hash", "6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17" ] H.diffFileVsGoldenFile voteFile voteGold diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view index df2c2c4bed..0a21699f6f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-constitution.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "2399719c6477ac0cd1348ef84d6752194280b10b58163593366f6e2ca9f28cd2", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view index 287ddec4f2..6ffc55b5cd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-info.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view index dfe2aedea2..5b5001d71c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/create-no-confidence.action.view @@ -1,6 +1,6 @@ { "anchor": { - "dataHash": "04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784", + "dataHash": "c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745", "url": "proposal-dummy-url" }, "deposit": 10, diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view index e8b331ebdc..cb2c2587bd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/action/view/update-committee.action.view @@ -1,5 +1,5 @@ anchor: - dataHash: 04c36ab926c8d0e6b37d03c781bdf0214b67f65af6eb1241459d17209a0bf784 + dataHash: c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745 url: proposal-dummy-url deposit: 10 governance action: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/update-committee-answer.json b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/update-committee-answer.json new file mode 100644 index 0000000000..358e5c675f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/committee/update-committee-answer.json @@ -0,0 +1,5 @@ +{ + "type": "Governance proposal", + "description": "", + "cborHex": "8400581de08f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058504f680a28200581cc0f2510d2353ee41a508b3c700c807e52697f2813fb014e3bc6982cd18ca8200581cf5ba9ae54a389cf97c54b981513d780877fc888579148044a8e7e7f218fcd81e8218331864826c687474703a2f2f64756d6d795820c9decb4498c4924d4f9804b6fa3425bab8f669f6452cb61f295114c906f3093e" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote index 9cc83ddefa..de81fe3c92 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/vote @@ -1,5 +1,5 @@ { "type": "Governance voting procedures", "description": "", - "cborHex": "a18202581ceb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294da1825820b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a05820182781868747470733a2f2f6578616d706c652e636f6d2f766f746558206c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de" + "cborHex": "a18202581ceb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294da1825820b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a05820182781868747470733a2f2f6578616d706c652e636f6d2f766f746558206163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17" } diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON index a3a88209e1..7735c831fc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewJSON @@ -2,7 +2,7 @@ "drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d": { "b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5": { "anchor": { - "dataHash": "6c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de", + "dataHash": "6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17", "url": "https://example.com/vote" }, "decision": "VoteYes" diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML index 9e0fc234a8..3333ddb8c8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML +++ b/cardano-cli/test/cardano-cli-golden/files/golden/governance/vote/voteViewYAML @@ -1,6 +1,6 @@ drep-keyHash-eb09d5556a8bce421074e394d02c79ced96741657b4cf7ca8995294d: b1015258a99351c143a7a40b7b58f033ace10e3cc09c67780ed5b2b0992aa60a#5: anchor: - dataHash: 6c4aa4dc17fc4d173f1c9a23c266acba6f942e7ae9f06103ea0ed1333b8d68de + dataHash: 6163683a90d8cb460a38cdcf0d7bab286f0f004ec6e761dc670c2ca4d3709a17 url: https://example.com/vote decision: VoteYes diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli index 1ec924bcb1..62eff7084b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -5894,7 +5894,7 @@ Usage: cardano-cli conway genesis hash --genesis FILE Compute the hash of a genesis file -Usage: cardano-cli conway governance (action | committee | drep | vote) +Usage: cardano-cli conway governance (action | committee | drep | hash | vote) Governance commands. @@ -5921,11 +5921,8 @@ Usage: cardano-cli conway governance action create-constitution ) [--governance-action-tx-id TXID --governance-action-index WORD32] - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --constitution-anchor-url TEXT ( --constitution-anchor-metadata TEXT | --constitution-anchor-metadata-file FILE @@ -5944,11 +5941,8 @@ Usage: cardano-cli conway governance action update-committee | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [ --remove-cc-cold-verification-key STRING | --remove-cc-cold-verification-key-file FILE | --remove-cc-cold-verification-key-hash STRING @@ -5972,11 +5966,8 @@ Usage: cardano-cli conway governance action create-info (--mainnet | --testnet) | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --out-file FILE Create an info action. @@ -5990,11 +5981,8 @@ Usage: cardano-cli conway governance action create-no-confidence | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --governance-action-tx-id TXID --governance-action-index WORD32 --out-file FILE @@ -6010,11 +5998,8 @@ Usage: cardano-cli conway governance action create-protocol-parameters-update | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [--governance-action-tx-id TXID --governance-action-index WORD32] [--min-fee-constant LOVELACE] @@ -6071,11 +6056,8 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --deposit-return-stake-verification-key-file FILE | --deposit-return-stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [ ( --funds-receiving-stake-verification-key STRING | --funds-receiving-stake-verification-key-file FILE @@ -6195,6 +6177,15 @@ Usage: cardano-cli conway governance drep metadata-hash --drep-metadata-file FIL Calculate the hash of a metadata file. +Usage: cardano-cli conway governance hash + ( --text TEXT + | --file-binary FILE + | --file-text FILE + ) + + Compute the hash to pass to the various --*-hash arguments of governance + commands. + Usage: cardano-cli conway governance vote (create | view) Vote commands. @@ -6212,11 +6203,8 @@ Usage: cardano-cli conway governance vote create (--yes | --no | --abstain) | --cc-hot-verification-key-file FILE | --cc-hot-key-hash STRING ) - [--vote-anchor-url TEXT - ( --vote-anchor-metadata TEXT - | --vote-anchor-metadata-file FILE - | --vote-anchor-metadata-hash HASH - )] + [--anchor-url TEXT + --anchor-data-hash HASH] --out-file FILE Vote creation. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance.cli index b70383ce8a..b91133a932 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance.cli @@ -1,4 +1,4 @@ -Usage: cardano-cli conway governance (action | committee | drep | vote) +Usage: cardano-cli conway governance (action | committee | drep | hash | vote) Governance commands. @@ -9,4 +9,6 @@ Available commands: action Governance action commands. committee Committee member commands. drep DRep member commands. + hash Compute the hash to pass to the various --*-hash + arguments of governance commands. vote Vote commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-constitution.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-constitution.cli index a9dd22e4f0..bc5ea30913 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-constitution.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-constitution.cli @@ -9,11 +9,8 @@ Usage: cardano-cli conway governance action create-constitution ) [--governance-action-tx-id TXID --governance-action-index WORD32] - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --constitution-anchor-url TEXT ( --constitution-anchor-metadata TEXT | --constitution-anchor-metadata-file FILE @@ -37,14 +34,9 @@ Available options: Previous txid of the governance action. --governance-action-index WORD32 Previous tx's governance action index. - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --constitution-anchor-url TEXT Constitution anchor URL. --constitution-anchor-metadata TEXT diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-info.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-info.cli index d9b20e1019..aaa4f04c93 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-info.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-info.cli @@ -4,11 +4,8 @@ Usage: cardano-cli conway governance action create-info (--mainnet | --testnet) | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --out-file FILE Create an info action. @@ -23,14 +20,9 @@ Available options: --stake-verification-key-file FILE Filepath of the staking verification key. --stake-key-hash HASH Stake verification key hash (hex-encoded). - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --out-file FILE Path to action file to be used later on with build or build-raw -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-no-confidence.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-no-confidence.cli index 0e2e456eb4..6f8c4d8115 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-no-confidence.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-no-confidence.cli @@ -7,11 +7,8 @@ Usage: cardano-cli conway governance action create-no-confidence | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH --governance-action-tx-id TXID --governance-action-index WORD32 --out-file FILE @@ -28,14 +25,9 @@ Available options: --stake-verification-key-file FILE Filepath of the staking verification key. --stake-key-hash HASH Stake verification key hash (hex-encoded). - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --governance-action-tx-id TXID Previous txid of `NoConfidence` or `NewCommittee` governance action. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-protocol-parameters-update.cli index cf3d3445f2..9680bc505c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-protocol-parameters-update.cli @@ -7,11 +7,8 @@ Usage: cardano-cli conway governance action create-protocol-parameters-update | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [--governance-action-tx-id TXID --governance-action-index WORD32] [--min-fee-constant LOVELACE] @@ -69,14 +66,9 @@ Available options: --stake-verification-key-file FILE Filepath of the staking verification key. --stake-key-hash HASH Stake verification key hash (hex-encoded). - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --governance-action-tx-id TXID Previous txid of the governance action. --governance-action-index WORD32 diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli index 0542b7420b..34f2e1e103 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli @@ -7,11 +7,8 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --deposit-return-stake-verification-key-file FILE | --deposit-return-stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [ ( --funds-receiving-stake-verification-key STRING | --funds-receiving-stake-verification-key-file FILE @@ -33,14 +30,9 @@ Available options: Filepath of the staking verification key. --deposit-return-stake-key-hash HASH Stake verification key hash (hex-encoded). - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --funds-receiving-stake-verification-key STRING Stake verification key (Bech32 or hex-encoded). --funds-receiving-stake-verification-key-file FILE diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_update-committee.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_update-committee.cli index a880250f8c..62e7536fab 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_update-committee.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_update-committee.cli @@ -7,11 +7,8 @@ Usage: cardano-cli conway governance action update-committee | --stake-verification-key-file FILE | --stake-key-hash HASH ) - --proposal-anchor-url TEXT - ( --proposal-anchor-metadata TEXT - | --proposal-anchor-metadata-file FILE - | --proposal-anchor-metadata-hash HASH - ) + --anchor-url TEXT + --anchor-data-hash HASH [ --remove-cc-cold-verification-key STRING | --remove-cc-cold-verification-key-file FILE | --remove-cc-cold-verification-key-hash STRING @@ -39,14 +36,9 @@ Available options: --stake-verification-key-file FILE Filepath of the staking verification key. --stake-key-hash HASH Stake verification key hash (hex-encoded). - --proposal-anchor-url TEXT - Proposal anchor URL - --proposal-anchor-metadata TEXT - Proposal anchor contents as UTF-8 encoded text. - --proposal-anchor-metadata-file FILE - Proposal anchor contents as a text file. - --proposal-anchor-metadata-hash HASH - Proposal anchor data hash. + --anchor-url TEXT Anchor URL + --anchor-data-hash HASH Proposal anchor data hash (obtain it with + "cardano-cli conway governance hash ...") --remove-cc-cold-verification-key STRING Constitutional Committee cold key (hex-encoded). --remove-cc-cold-verification-key-file FILE diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_hash.cli new file mode 100644 index 0000000000..ba527404ef --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_hash.cli @@ -0,0 +1,14 @@ +Usage: cardano-cli conway governance hash + ( --text TEXT + | --file-binary FILE + | --file-text FILE + ) + + Compute the hash to pass to the various --*-hash arguments of governance + commands. + +Available options: + --text TEXT Text to hash as UTF-8 + --file-binary FILE Binary file to hash + --file-text FILE Text file to hash + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote_create.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote_create.cli index 01fa169852..29dc516719 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote_create.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_vote_create.cli @@ -11,11 +11,8 @@ Usage: cardano-cli conway governance vote create (--yes | --no | --abstain) | --cc-hot-verification-key-file FILE | --cc-hot-key-hash STRING ) - [--vote-anchor-url TEXT - ( --vote-anchor-metadata TEXT - | --vote-anchor-metadata-file FILE - | --vote-anchor-metadata-hash HASH - )] + [--anchor-url TEXT + --anchor-data-hash HASH] --out-file FILE Vote creation. @@ -45,12 +42,8 @@ Available options: --cc-hot-verification-key-file FILE Filepath of the Consitutional Committee hot key. --cc-hot-key-hash STRING Constitutional Committee key hash (hex-encoded). - --vote-anchor-url TEXT Vote anchor URL - --vote-anchor-metadata TEXT - Vote anchor contents as UTF-8 encoded text. - --vote-anchor-metadata-file FILE - Vote anchor contents as a text file. - --vote-anchor-metadata-hash HASH - Hash of the vote anchor data. + --anchor-url TEXT Vote anchor URL + --anchor-data-hash HASH Hash of the vote anchor data (obtain it with + "cardano-cli conway governance hash ..."). --out-file FILE Output filepath of the vote. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold1.vkey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold1.vkey new file mode 100644 index 0000000000..8832ca53bc --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold1.vkey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeColdVerificationKey_ed25519", + "description": "Constitutional Committee Cold Verification Key", + "cborHex": "5820b18096da5d51818f8890d6a7c9c7b21d555e03e347f4ec07be09e0ddef96a984" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold2.vkey b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold2.vkey new file mode 100644 index 0000000000..55c9ae48c2 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-cold2.vkey @@ -0,0 +1,5 @@ +{ + "type": "ConstitutionalCommitteeColdVerificationKey_ed25519", + "description": "Constitutional Committee Cold Verification Key", + "cborHex": "58209f70f7288b9db552db64e42e1442265515ff544cf95beb514d2fcf6c9d9dac6a" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-proposal.txt b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-proposal.txt new file mode 100644 index 0000000000..9158bce2b4 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/input/governance/committee/cc-proposal.txt @@ -0,0 +1,2 @@ +WE, THE PEOPLE of Barataria, in order to maintain peace and harmony among us, establish this Constitution for our +precious Insula of Barataria: Article 1. The person who waters wine or changes the label should lose his life for it. \ No newline at end of file