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 65b151ab6e..760e7bf67d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs @@ -38,7 +38,7 @@ data GovernanceActionCmds era | GovernanceActionCreateNoConfidenceCmd !(GovernanceActionCreateNoConfidenceCmdArgs era) | GovernanceActionProtocolParametersUpdateCmd !(GovernanceActionProtocolParametersUpdateCmdArgs era) | GovernanceActionTreasuryWithdrawalCmd !(GovernanceActionTreasuryWithdrawalCmdArgs era) - | GovernanceActionHardforkInitCmd !(GovernanceActionHardforkInitCmdArgs era) + | GovernanceActionHardforkInitCmd !(GovernanceActionHardforkInitCmdArgs era) | GovernanceActionInfoCmd !(GovernanceActionInfoCmdArgs era) | GovernanceActionViewCmd !(GovernanceActionViewCmdArgs era) deriving Show @@ -87,15 +87,14 @@ data GovernanceActionInfoCmdArgs era data GovernanceActionCreateNoConfidenceCmdArgs era = GovernanceActionCreateNoConfidenceCmdArgs - { eon :: !(ConwayEraOnwards era) - , networkId :: !L.Network - , deposit :: !L.Coin - , returnStakeAddress :: !StakeIdentifier - , proposalUrl :: !ProposalUrl - , proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData) - , governanceActionId :: !TxId - , governanceActionIndex :: !Word32 - , outFile :: !(File () Out) + { eon :: !(ConwayEraOnwards era) + , networkId :: !L.Network + , deposit :: !L.Coin + , returnStakeAddress :: !StakeIdentifier + , proposalUrl :: !ProposalUrl + , proposalHash :: !(L.SafeHash L.StandardCrypto L.AnchorData) + , mPrevGovernanceActionId :: !(Maybe (TxId, Word32)) + , outFile :: !(File () Out) } deriving Show data GovernanceActionProtocolParametersUpdateCmdArgs 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 9ddc676a46..3da653f764 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -147,8 +147,7 @@ pGovernanceActionNoConfidenceCmd era = do <*> pStakeIdentifier (Just "deposit-return") <*> pAnchorUrl <*> pAnchorDataHash - <*> pTxId "prev-governance-action-tx-id" "Txid of the previous governance action." - <*> pWord32 "prev-governance-action-index" "Action index of the previous governance action." + <*> pPreviousGovernanceAction <*> pFileOutDirection "out-file" "Output filepath of the no confidence proposal." ) $ Opt.progDesc "Create a no confidence proposal." @@ -395,17 +394,17 @@ pNewProtVer = (,) <$> pProtMajor <*> pProtMinor [ Opt.long "protocol-major-version" , Opt.metavar "MAJOR" , Opt.help $ mconcat - ["Specify the major protocol version to fork into. It must be the next natural number " + ["Specify the major protocol version to fork into. It must be the next natural number " , "after the current version and must be supported by the node." ] - ] - + ] + pProtMinor :: Parser Natural pProtMinor = Opt.option Opt.auto $ mconcat [ Opt.long "protocol-minor-version" , Opt.metavar "MINOR" - , Opt.help "Minor protocol version. Must be zero when the major protocol version is increased." + , Opt.help "Minor protocol version. Must be zero when the major protocol version is increased." ] pPV :: Parser L.ProtVer 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 01f73c80a5..cdd836b560 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -117,8 +117,7 @@ runGovernanceActionCreateNoConfidenceCmd , Cmd.returnStakeAddress , Cmd.proposalUrl , Cmd.proposalHash - , Cmd.governanceActionId - , Cmd.governanceActionIndex + , Cmd.mPrevGovernanceActionId , Cmd.outFile } = do depositStakeCredential @@ -131,12 +130,10 @@ runGovernanceActionCreateNoConfidenceCmd } let sbe = conwayEraOnwardsToShelleyBasedEra eon - previousGovernanceAction = MotionOfNoConfidence - $ L.SJust - $ shelleyBasedEraConstraints sbe - $ createPreviousGovernanceActionId - governanceActionId - governanceActionIndex + previousGovernanceAction = + MotionOfNoConfidence $ L.maybeToStrictMaybe + $ shelleyBasedEraConstraints sbe + $ uncurry createPreviousGovernanceActionId <$> mPrevGovernanceActionId proposalProcedure = createProposalProcedure sbe networkId deposit depositStakeCredential previousGovernanceAction proposalAnchor @@ -416,4 +413,4 @@ runGovernanceActionHardforkInitCmd firstExceptT GovernanceActionsCmdWriteFileError . newExceptT $ conwayEraOnwardsConstraints eon - $ writeFileTextEnvelope outFile (Just "Hardfork initiation proposal") proposalProcedure \ No newline at end of file + $ writeFileTextEnvelope outFile (Just "Hardfork initiation proposal") proposalProcedure 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 f4dd3c0c05..a89fcd02b1 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -6770,8 +6770,8 @@ Usage: cardano-cli conway governance action create-no-confidence ) --anchor-url TEXT --anchor-data-hash HASH - --prev-governance-action-tx-id TXID - --prev-governance-action-index WORD32 + [--prev-governance-action-tx-id TXID + --prev-governance-action-index WORD32] --out-file FILE Create a no confidence proposal. 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 8357e129d4..18880bc996 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 @@ -11,8 +11,8 @@ Usage: cardano-cli conway governance action create-no-confidence ) --anchor-url TEXT --anchor-data-hash HASH - --prev-governance-action-tx-id TXID - --prev-governance-action-index WORD32 + [--prev-governance-action-tx-id TXID + --prev-governance-action-index WORD32] --out-file FILE Create a no confidence proposal.