From 992fc78ab5eadda6f503b10a7a78a30a6bdc4f9e Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Wed, 11 Oct 2023 12:49:25 -0400 Subject: [PATCH 1/4] Fix cardano-cli $era stake-address deregistration-certificate so that it only asks for the key deposit in the Conway era onwards --- .../CLI/EraBased/Options/StakeAddress.hs | 32 +++++++++++++------ .../Cardano/CLI/EraBased/Run/StakeAddress.hs | 1 + 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/StakeAddress.hs index be0d1a6ec3..f972ee4e1c 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/StakeAddress.hs @@ -14,6 +14,7 @@ import Cardano.CLI.EraBased.Options.Common import Options.Applicative import qualified Options.Applicative as Opt + pStakeAddressCmds :: () => CardanoEra era -> EnvCli @@ -99,16 +100,27 @@ pStakeAddressDeregistrationCertificateCmd :: () => CardanoEra era -> Maybe (Parser (StakeAddressCmds era)) pStakeAddressDeregistrationCertificateCmd era = do - w <- forEraMaybeEon era - pure - $ subParser "deregistration-certificate" - $ Opt.info - ( StakeAddressDeregistrationCertificateCmd w - <$> pStakeIdentifier - <*> optional pKeyRegistDeposit - <*> pOutputFile - ) - $ Opt.progDesc "Create a stake address deregistration certificate" + forEraInEonMaybe era $ \sbe -> + caseShelleyToBabbageOrConwayEraOnwards + (\shelleyToBabbage -> subParser "deregistration-certificate" + $ Opt.info + ( StakeAddressDeregistrationCertificateCmd (shelleyToBabbageEraToShelleyBasedEra shelleyToBabbage) + <$> pStakeIdentifier + <*> pure Nothing + <*> pOutputFile + ) + $ Opt.progDesc "Create a stake address deregistration certificate" + ) + (\conwayOnwards -> subParser "deregistration-certificate" + $ Opt.info + ( StakeAddressDeregistrationCertificateCmd (conwayEraOnwardsToShelleyBasedEra conwayOnwards) + <$> pStakeIdentifier + <*> fmap Just pKeyRegistDeposit + <*> pOutputFile + ) + $ Opt.progDesc "Create a stake address deregistration certificate" + ) + sbe pStakeAddressStakeDelegationCertificateCmd :: () => CardanoEra era diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs index 781e5c7ace..f9885f9ee8 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs @@ -162,6 +162,7 @@ createRegistrationCertRequirements sbe stakeCred mdeposit = return $ StakeAddrRegistrationPreConway ShelleyToBabbageEraBabbage stakeCred ShelleyBasedEraConway -> case mdeposit of + -- TODO: This error constructor will never be called Nothing -> Left StakeAddressRegistrationDepositRequired Just dep -> return $ StakeAddrRegistrationConway ConwayEraOnwardsConway dep stakeCred From 814a3d40a67a4f5f4cd49be6e44f9bc13803de40 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Wed, 11 Oct 2023 13:49:56 -0400 Subject: [PATCH 2/4] Update cardano-cli $era governance action create-protocol-parameters-update command to create a governance action in the conway era Co-authored-by: John Ky --- .../EraBased/Commands/Governance/Actions.hs | 41 +++++++-- .../EraBased/Options/Governance/Actions.hs | 68 +++++++++++---- .../CLI/EraBased/Run/Governance/Actions.hs | 86 +++++++++++++------ cardano-cli/src/Cardano/CLI/Types/Common.hs | 1 + .../Types/Errors/GovernanceActionsError.hs | 6 ++ 5 files changed, 151 insertions(+), 51 deletions(-) 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 8eff11d89f..73cad03401 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs @@ -1,7 +1,10 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE StandaloneDeriving #-} + module Cardano.CLI.EraBased.Commands.Governance.Actions ( GovernanceActionCmds(..) @@ -12,6 +15,8 @@ module Cardano.CLI.EraBased.Commands.Governance.Actions , GovernanceActionViewCmdArgs(..) , GovernanceActionProtocolParametersUpdateCmdArgs(..) , GovernanceActionTreasuryWithdrawalCmdArgs(..) + , UpdateProtocolParametersConwayOnwards(..) + , UpdateProtocolParametersPreConway(..) , renderGovernanceActionCmds , AnyStakeIdentifier(..) @@ -31,7 +36,9 @@ data GovernanceActionCmds era = GovernanceActionCreateConstitutionCmd !(GovernanceActionCreateConstitutionCmdArgs era) | GoveranceActionUpdateCommitteeCmd !(GoveranceActionUpdateCommitteeCmdArgs era) | GovernanceActionCreateNoConfidenceCmd !(GovernanceActionCreateNoConfidenceCmdArgs era) - | GovernanceActionProtocolParametersUpdateCmd !(GovernanceActionProtocolParametersUpdateCmdArgs era) + | GovernanceActionProtocolParametersUpdateCmd + (ShelleyBasedEra era) + !(GovernanceActionProtocolParametersUpdateCmdArgs era) | GovernanceActionTreasuryWithdrawalCmd !(GovernanceActionTreasuryWithdrawalCmdArgs era) | GovernanceActionInfoCmd !(GovernanceActionInfoCmdArgs era) | GovernanceActionViewCmd !(GovernanceActionViewCmdArgs era) @@ -93,11 +100,10 @@ data GovernanceActionCreateNoConfidenceCmdArgs era data GovernanceActionProtocolParametersUpdateCmdArgs era = GovernanceActionProtocolParametersUpdateCmdArgs - { eon :: !(ConwayEraOnwards era) - , epochNo :: !EpochNo - , genesisVkeyFiles :: ![VerificationKeyFile In] - , pparamsUpdate :: !(EraBasedProtocolParametersUpdate era) - , outFile :: !(File () Out) + { uppPreConway :: Maybe (UpdateProtocolParametersPreConway era) + , uppConwayOnwards :: Maybe (UpdateProtocolParametersConwayOnwards era) + , uppNewPParams :: EraBasedProtocolParametersUpdate era + , uppFilePath :: File () Out } deriving Show data GovernanceActionTreasuryWithdrawalCmdArgs era @@ -120,6 +126,29 @@ data GovernanceActionViewCmdArgs era , mOutFile :: !(Maybe (File () Out)) } deriving Show +data UpdateProtocolParametersConwayOnwards era + = UpdateProtocolParametersConwayOnwards + { eon :: !(ConwayEraOnwards era) + , networkId :: !Ledger.Network + , deposit :: !Lovelace + , returnAddr :: !AnyStakeIdentifier + , proposalUrl :: !ProposalUrl + , proposalHashSource :: !ProposalHashSource + , governanceActionId :: !(Maybe (TxId, Word32)) + } + +deriving instance Show (UpdateProtocolParametersConwayOnwards era) + +data UpdateProtocolParametersPreConway era + = UpdateProtocolParametersPreConway + { eon :: ShelleyToBabbageEra era + , expiryEpoch :: EpochNo + , genesisVerificationKeys :: [VerificationKeyFile In] + } + + +deriving instance Show (UpdateProtocolParametersPreConway era) + renderGovernanceActionCmds :: GovernanceActionCmds era -> Text renderGovernanceActionCmds = ("governance action " <>) . \case GovernanceActionCreateConstitutionCmd {} -> 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 f527dd7952..e7d3fbc61f 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -160,23 +160,58 @@ pAnyStakeIdentifier prefix = , Cmd.AnyStakeKey <$> pStakeVerificationKeyOrHashOrFile prefix ] +pUpdateProtocolParametersPreConway :: ShelleyToBabbageEra era -> Parser (Cmd.UpdateProtocolParametersPreConway era) +pUpdateProtocolParametersPreConway shelleyToBab = + Cmd.UpdateProtocolParametersPreConway shelleyToBab + <$> pEpochNoUpdateProp + <*> pProtocolParametersUpdateGenesisKeys + +pUpdateProtocolParametersPostConway :: ConwayEraOnwards era -> Parser (Cmd.UpdateProtocolParametersConwayOnwards era) +pUpdateProtocolParametersPostConway conwayOnwards = + Cmd.UpdateProtocolParametersConwayOnwards conwayOnwards + <$> pNetwork + <*> pGovActionDeposit + <*> pAnyStakeIdentifier Nothing + <*> pProposalUrl + <*> pProposalHashSource + <*> pPreviousGovernanceAction + + +pUpdateProtocolParametersCmd :: ShelleyBasedEra era -> Parser (Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era) +pUpdateProtocolParametersCmd = + caseShelleyToBabbageOrConwayEraOnwards + (\shelleyToBab -> + let sbe = shelleyToBabbageEraToShelleyBasedEra shelleyToBab + in subParser "create-protocol-parameters-update" + $ Opt.info + ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs + <$> fmap Just (pUpdateProtocolParametersPreConway shelleyToBab) + <*> pure Nothing + <*> dpGovActionProtocolParametersUpdate sbe + <*> pOutputFile + ) + $ Opt.progDesc "Create a protocol parameters update.") + (\conwayOnwards -> + let sbe = conwayEraOnwardsToShelleyBasedEra conwayOnwards + in subParser "create-protocol-parameters-update" + $ Opt.info + ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs Nothing + <$> fmap Just (pUpdateProtocolParametersPostConway conwayOnwards) + <*> dpGovActionProtocolParametersUpdate sbe + <*> pOutputFile + ) + $ Opt.progDesc "Create a protocol parameters update." + + ) + pGovernanceActionProtocolParametersUpdateCmd :: () => CardanoEra era -> Maybe (Parser (Cmd.GovernanceActionCmds era)) pGovernanceActionProtocolParametersUpdateCmd era = do - eon <- forEraMaybeEon era - let sbe = conwayEraOnwardsToShelleyBasedEra eon - pure - $ subParser "create-protocol-parameters-update" - $ Opt.info - ( fmap Cmd.GovernanceActionProtocolParametersUpdateCmd $ - Cmd.GovernanceActionProtocolParametersUpdateCmdArgs eon - <$> pEpochNoUpdateProp - <*> pProtocolParametersUpdateGenesisKeys sbe - <*> dpGovActionProtocolParametersUpdate sbe - <*> pOutputFile - ) - $ Opt.progDesc "Create a protocol parameters update." + w <- forEraMaybeEon era + pure $ Cmd.GovernanceActionProtocolParametersUpdateCmd w + <$> pUpdateProtocolParametersCmd w + convertToLedger :: (a -> b) -> Parser (Maybe a) -> Parser (StrictMaybe b) convertToLedger conv = fmap (maybeToStrictMaybe . fmap conv) @@ -262,11 +297,8 @@ pIntroducedInConwayPParams = <*> convertToLedger id (optional pDRepActivity) -- Not necessary in Conway era onwards -pProtocolParametersUpdateGenesisKeys :: ShelleyBasedEra era -> Parser [VerificationKeyFile In] -pProtocolParametersUpdateGenesisKeys = - caseShelleyToBabbageOrConwayEraOnwards - (const (many pGenesisVerificationKeyFile)) - (const empty) +pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In] +pProtocolParametersUpdateGenesisKeys = many pGenesisVerificationKeyFile dpGovActionProtocolParametersUpdate :: ShelleyBasedEra era -> Parser (EraBasedProtocolParametersUpdate era) 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 afdf7d8f96..44c98fcde9 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -38,8 +38,8 @@ runGovernanceActionCmds = \case GovernanceActionCreateConstitutionCmd args -> runGovernanceActionCreateConstitutionCmd args - GovernanceActionProtocolParametersUpdateCmd args -> - runGovernanceActionCreateProtocolParametersUpdateCmd args + GovernanceActionProtocolParametersUpdateCmd sbe args -> + runGovernanceActionCreateProtocolParametersUpdateCmd sbe args GovernanceActionTreasuryWithdrawalCmd args -> runGovernanceActionTreasuryWithdrawalCmd args @@ -244,33 +244,65 @@ runGovernanceActionCreateNewCommitteeCmd $ writeFileTextEnvelope outFile Nothing proposal runGovernanceActionCreateProtocolParametersUpdateCmd :: () - => Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era + => ShelleyBasedEra era + -> Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era -> ExceptT GovernanceActionsError IO () -runGovernanceActionCreateProtocolParametersUpdateCmd - Cmd.GovernanceActionProtocolParametersUpdateCmdArgs - { Cmd.eon - , Cmd.epochNo - , Cmd.genesisVkeyFiles - , Cmd.pparamsUpdate - , Cmd.outFile - } = do - let sbe = conwayEraOnwardsToShelleyBasedEra eon +runGovernanceActionCreateProtocolParametersUpdateCmd sbe eraBasedPParams' = do + caseShelleyToBabbageOrConwayEraOnwards + (\sToB -> do + let oFp = uppFilePath eraBasedPParams' + anyEra = AnyShelleyBasedEra $ shelleyToBabbageEraToShelleyBasedEra sToB + UpdateProtocolParametersPreConway _cOn expEpoch genesisVerKeys + <- hoistMaybe (GovernanceActionsValueUpdateProtocolParametersNotFound anyEra) + $ uppPreConway eraBasedPParams' + let eraBasedPParams = uppNewPParams eraBasedPParams' + updateProtocolParams = createEraBasedProtocolParamUpdate sbe eraBasedPParams + apiUpdateProtocolParamsType = fromLedgerPParamsUpdate sbe updateProtocolParams + genVKeys <- sequence + [ firstExceptT GovernanceActionsCmdReadTextEnvelopeFileError . newExceptT + $ readFileTextEnvelope (AsVerificationKey AsGenesisKey) vkeyFile + | vkeyFile <- genesisVerKeys + ] + let genKeyHashes = fmap verificationKeyHash genVKeys + upProp = makeShelleyUpdateProposal apiUpdateProtocolParamsType genKeyHashes expEpoch + firstExceptT GovernanceActionsCmdWriteFileError . newExceptT + $ writeLazyByteStringFile oFp $ textEnvelopeToJSON Nothing upProp + ) + (\conwayOnwards -> do + let oFp = uppFilePath eraBasedPParams' + anyEra = AnyShelleyBasedEra $ conwayEraOnwardsToShelleyBasedEra conwayOnwards + + UpdateProtocolParametersConwayOnwards _cOnwards network deposit returnAddr proposalUrl + proposalHashSource mPrevGovActId + <- hoistMaybe (GovernanceActionsValueUpdateProtocolParametersNotFound anyEra) + $ uppConwayOnwards eraBasedPParams' + + returnKeyHash <- readStakeKeyHash returnAddr + + proposalHash <- + proposalHashSourceToHash proposalHashSource + & firstExceptT GovernanceActionsCmdProposalError + + let eraBasedPParams = uppNewPParams eraBasedPParams' + updateProtocolParams = createEraBasedProtocolParamUpdate sbe eraBasedPParams + apiUpdateProtocolParamsType = fromLedgerPParamsUpdate sbe updateProtocolParams + + prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovActId + proposalAnchor = Ledger.Anchor + { Ledger.anchorUrl = unProposalUrl proposalUrl + , Ledger.anchorDataHash = proposalHash + } + govAct = UpdatePParams prevGovActId apiUpdateProtocolParamsType + + + let proposalProcedure = createProposalProcedure sbe network deposit returnKeyHash govAct proposalAnchor + + firstExceptT GovernanceActionsCmdWriteFileError . newExceptT + $ conwayEraOnwardsConstraints conwayOnwards + $ writeFileTextEnvelope oFp Nothing proposalProcedure + ) + sbe - genVKeys <- sequence - [ firstExceptT GovernanceActionsCmdReadTextEnvelopeFileError . newExceptT - $ readFileTextEnvelope (AsVerificationKey AsGenesisKey) vkeyFile - | vkeyFile <- genesisVkeyFiles - ] - - let updateProtocolParams = createEraBasedProtocolParamUpdate sbe pparamsUpdate - apiUpdateProtocolParamsType = fromLedgerPParamsUpdate sbe updateProtocolParams - genKeyHashes = fmap verificationKeyHash genVKeys - -- TODO: Update EraBasedProtocolParametersUpdate to require genesis delegate keys - -- depending on the era - upProp = makeShelleyUpdateProposal apiUpdateProtocolParamsType genKeyHashes epochNo - - firstExceptT GovernanceActionsCmdWriteFileError . newExceptT - $ writeLazyByteStringFile outFile $ textEnvelopeToJSON Nothing upProp readStakeKeyHash :: AnyStakeIdentifier -> ExceptT GovernanceActionsError IO (Hash StakeKey) readStakeKeyHash anyStake = diff --git a/cardano-cli/src/Cardano/CLI/Types/Common.hs b/cardano-cli/src/Cardano/CLI/Types/Common.hs index abe4d049fd..f853bce65b 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Common.hs @@ -85,6 +85,7 @@ import Cardano.Api import qualified Cardano.Api.Ledger as L import qualified Cardano.Chain.Slotting as Byron +import Cardano.Ledger.BaseTypes (AnchorData (AnchorData)) import qualified Cardano.Ledger.BaseTypes as L import qualified Cardano.Ledger.Crypto as Crypto import qualified Cardano.Ledger.SafeHash as L diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs index 3de3b4d59b..962bc54d2f 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/GovernanceActionsError.hs @@ -14,6 +14,7 @@ data GovernanceActionsError | GovernanceActionsCmdReadFileError (FileError InputDecodeError) | GovernanceActionsCmdReadTextEnvelopeFileError (FileError TextEnvelopeError) | GovernanceActionsCmdWriteFileError (FileError ()) + | GovernanceActionsValueUpdateProtocolParametersNotFound AnyShelleyBasedEra deriving Show instance Error GovernanceActionsError where @@ -28,3 +29,8 @@ instance Error GovernanceActionsError where "Cannot read text envelope file: " <> displayError e GovernanceActionsCmdWriteFileError e -> "Cannot write file: " <> displayError e + GovernanceActionsValueUpdateProtocolParametersNotFound (AnyShelleyBasedEra expectedShelleyEra) -> + mconcat + [ "Protocol parameters update value for " <> show (toCardanoEra expectedShelleyEra) + , " was not found." + ] From 6e4323cf1f5a7ebec7b558b1725c826aac5c7776 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Thu, 12 Oct 2023 14:31:02 -0400 Subject: [PATCH 3/4] Update golden files --- cardano-cli/src/Cardano/CLI/Types/Common.hs | 1 - .../cardano-cli-golden/files/golden/help.cli | 227 +++++++++++++++++- .../files/golden/help/allegra_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 71 ++++++ ...ake-address_deregistration-certificate.cli | 3 - .../files/golden/help/alonzo_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 103 ++++++++ ...ake-address_deregistration-certificate.cli | 3 - .../files/golden/help/babbage_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 95 ++++++++ ...ake-address_deregistration-certificate.cli | 3 - ...tion_create-protocol-parameters-update.cli | 51 +++- ...ake-address_deregistration-certificate.cli | 2 +- .../files/golden/help/latest_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 95 ++++++++ ...ake-address_deregistration-certificate.cli | 3 - .../files/golden/help/mary_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 71 ++++++ ...ake-address_deregistration-certificate.cli | 3 - .../files/golden/help/shelley_governance.cli | 2 + ...tion_create-protocol-parameters-update.cli | 71 ++++++ ...ake-address_deregistration-certificate.cli | 3 - 22 files changed, 786 insertions(+), 31 deletions(-) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli diff --git a/cardano-cli/src/Cardano/CLI/Types/Common.hs b/cardano-cli/src/Cardano/CLI/Types/Common.hs index f853bce65b..abe4d049fd 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Common.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Common.hs @@ -85,7 +85,6 @@ import Cardano.Api import qualified Cardano.Api.Ledger as L import qualified Cardano.Chain.Slotting as Byron -import Cardano.Ledger.BaseTypes (AnchorData (AnchorData)) import qualified Cardano.Ledger.BaseTypes as L import qualified Cardano.Ledger.Crypto as Crypto import qualified Cardano.Ledger.SafeHash as L 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 be9e958486..a79d1bf73a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -265,6 +265,7 @@ Usage: cardano-cli shelley genesis hash --genesis FILE Usage: cardano-cli shelley governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -322,6 +323,36 @@ Usage: cardano-cli shelley governance create-genesis-key-delegation-certificate Create a genesis key delegation certificate +Usage: cardano-cli shelley governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli shelley governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli shelley node ( key-gen | key-gen-KES @@ -694,7 +725,6 @@ Usage: cardano-cli shelley stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -1426,6 +1456,7 @@ Usage: cardano-cli allegra genesis hash --genesis FILE Usage: cardano-cli allegra governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -1483,6 +1514,36 @@ Usage: cardano-cli allegra governance create-genesis-key-delegation-certificate Create a genesis key delegation certificate +Usage: cardano-cli allegra governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli allegra governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli allegra node ( key-gen | key-gen-KES @@ -1855,7 +1916,6 @@ Usage: cardano-cli allegra stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -2585,6 +2645,7 @@ Usage: cardano-cli mary genesis hash --genesis FILE Usage: cardano-cli mary governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -2642,6 +2703,36 @@ Usage: cardano-cli mary governance create-genesis-key-delegation-certificate Create a genesis key delegation certificate +Usage: cardano-cli mary governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli mary governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli mary node ( key-gen | key-gen-KES @@ -3004,7 +3095,6 @@ Usage: cardano-cli mary stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -3721,6 +3811,7 @@ Usage: cardano-cli alonzo genesis hash --genesis FILE Usage: cardano-cli alonzo governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -3778,6 +3869,43 @@ Usage: cardano-cli alonzo governance create-genesis-key-delegation-certificate Create a genesis key delegation certificate +Usage: cardano-cli alonzo governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli alonzo governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-word LOVELACE] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli alonzo node ( key-gen | key-gen-KES @@ -4150,7 +4278,6 @@ Usage: cardano-cli alonzo stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -4880,6 +5007,7 @@ Usage: cardano-cli babbage genesis hash --genesis FILE Usage: cardano-cli babbage governance ( create-mir-certificate + | action | create-poll | answer-poll | verify-poll @@ -4923,6 +5051,39 @@ Usage: cardano-cli babbage governance create-mir-certificate transfer-to-rewards Create an MIR certificate to transfer from the treasury pot to the reserves pot +Usage: cardano-cli babbage governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli babbage governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-byte LOVELACE] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli babbage governance create-poll --question STRING (--answer STRING) [--nonce UINT] @@ -5314,7 +5475,6 @@ Usage: cardano-cli babbage stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -6160,7 +6320,25 @@ Usage: cardano-cli conway governance action create-no-confidence Create a no confidence proposal. -Usage: cardano-cli conway governance action create-protocol-parameters-update --epoch NATURAL +Usage: cardano-cli conway governance action create-protocol-parameters-update + ( --mainnet + | --testnet + ) + --governance-action-deposit NATURAL + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILE + | --stake-pool-id STAKE_POOL_ID + | --stake-verification-key STRING + | --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 + ) + [--governance-action-tx-id TXID + --governance-action-index WORD32] [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -6836,7 +7014,7 @@ Usage: cardano-cli conway stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] + --key-reg-deposit-amt NATURAL --out-file FILE Create a stake address deregistration certificate @@ -7604,6 +7782,7 @@ Usage: cardano-cli latest genesis hash --genesis FILE Usage: cardano-cli latest governance ( create-mir-certificate + | action | create-poll | answer-poll | verify-poll @@ -7647,6 +7826,39 @@ Usage: cardano-cli latest governance create-mir-certificate transfer-to-rewards Create an MIR certificate to transfer from the treasury pot to the reserves pot +Usage: cardano-cli latest governance action create-protocol-parameters-update + + Governance action commands. + +Usage: cardano-cli latest governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-byte LOVELACE] + --out-file FILE + + Create a protocol parameters update. + Usage: cardano-cli latest governance create-poll --question STRING (--answer STRING) [--nonce UINT] @@ -8038,7 +8250,6 @@ Usage: cardano-cli latest stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance.cli index 9b8b362cb4..6df74258bb 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance.cli @@ -1,6 +1,7 @@ Usage: cardano-cli allegra governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -13,3 +14,4 @@ Available commands: certificate create-genesis-key-delegation-certificate Create a genesis key delegation certificate + action Governance action commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..c3dcd58ba7 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,71 @@ +Usage: cardano-cli allegra governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --min-utxo-value NATURAL The minimum allowed UTxO value (Shelley to Mary + eras). + --extra-entropy HEX Praos extra entropy seed, as a hex byte string. + --reset-extra-entropy Reset the Praos extra entropy to none. + --decentralization-parameter RATIONAL + Decentralization parameter. + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_stake-address_deregistration-certificate.cli index 509922fbed..8fa400c9fa 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli allegra stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance.cli index a524e300d0..4bf6b5ce60 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance.cli @@ -1,6 +1,7 @@ Usage: cardano-cli alonzo governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -13,3 +14,4 @@ Available commands: certificate create-genesis-key-delegation-certificate Create a genesis key delegation certificate + action Governance action commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..b1a0d2795f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,103 @@ +Usage: cardano-cli alonzo governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-word LOVELACE] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --extra-entropy HEX Praos extra entropy seed, as a hex byte string. + --reset-extra-entropy Reset the Praos extra entropy to none. + --decentralization-parameter RATIONAL + Decentralization parameter. + --price-execution-steps RATIONAL + Step price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --price-execution-memory RATIONAL + Memory price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --max-tx-execution-units (INT, INT) + Max total script execution resources units allowed + per tx (from Alonzo era). They are denominated as + follows (steps, memory). + --max-block-execution-units (INT, INT) + Max total script execution resources units allowed + per block (from Alonzo era). They are denominated as + follows (steps, memory). + --max-value-size INT Max size of a multi-asset value in a tx output (from + Alonzo era). + --collateral-percent INT The percentage of the script contribution to the + txfee that must be provided as collateral inputs when + including Plutus scripts (from Alonzo era). + --max-collateral-inputs INT + The maximum number of collateral inputs allowed in a + transaction (from Alonzo era). + --utxo-cost-per-word LOVELACE + Cost in lovelace per unit of UTxO storage (from + Alonzo era). + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_stake-address_deregistration-certificate.cli index a67b77785c..7b47ea7586 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli alonzo stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance.cli index cef7b28074..1ca4e1eec5 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance.cli @@ -1,5 +1,6 @@ Usage: cardano-cli babbage governance ( create-mir-certificate + | action | create-poll | answer-poll | verify-poll @@ -13,6 +14,7 @@ Available options: Available commands: create-mir-certificate Create an MIR (Move Instantaneous Rewards) certificate + action Governance action commands. create-poll Create an SPO poll answer-poll Answer an SPO poll verify-poll Verify an answer to a given SPO poll diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..92073b2c2d --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,95 @@ +Usage: cardano-cli babbage governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-byte LOVELACE] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --price-execution-steps RATIONAL + Step price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --price-execution-memory RATIONAL + Memory price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --max-tx-execution-units (INT, INT) + Max total script execution resources units allowed + per tx (from Alonzo era). They are denominated as + follows (steps, memory). + --max-block-execution-units (INT, INT) + Max total script execution resources units allowed + per block (from Alonzo era). They are denominated as + follows (steps, memory). + --max-value-size INT Max size of a multi-asset value in a tx output (from + Alonzo era). + --collateral-percent INT The percentage of the script contribution to the + txfee that must be provided as collateral inputs when + including Plutus scripts (from Alonzo era). + --max-collateral-inputs INT + The maximum number of collateral inputs allowed in a + transaction (from Alonzo era). + --utxo-cost-per-byte LOVELACE + Cost in lovelace per unit of UTxO storage (from + Babbage era). + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_stake-address_deregistration-certificate.cli index b6cf1e8351..bfbb053a96 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli babbage stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text 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 dbd8e54e7c..a833646b87 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 @@ -1,4 +1,22 @@ -Usage: cardano-cli conway governance action create-protocol-parameters-update --epoch NATURAL +Usage: cardano-cli conway governance action create-protocol-parameters-update + ( --mainnet + | --testnet + ) + --governance-action-deposit NATURAL + ( --stake-pool-verification-key STRING + | --cold-verification-key-file FILE + | --stake-pool-id STAKE_POOL_ID + | --stake-verification-key STRING + | --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 + ) + [--governance-action-tx-id TXID + --governance-action-index WORD32] [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -47,8 +65,35 @@ Usage: cardano-cli conway governance action create-protocol-parameters-update -- Create a protocol parameters update. Available options: - --epoch NATURAL The epoch number in which the update proposal is - valid. + --mainnet Use the mainnet magic id. + --testnet Use the testnet magic id. + --governance-action-deposit NATURAL + Deposit required to submit a governance action. + --stake-pool-verification-key STRING + Stake pool verification key (Bech32 or hex-encoded). + --cold-verification-key-file FILE + Filepath of the stake pool verification key. + --stake-pool-id STAKE_POOL_ID + Stake pool ID/verification key hash (either + Bech32-encoded or hex-encoded). Zero or more + occurences of this option is allowed. + --stake-verification-key STRING + Stake verification key (Bech32 or hex-encoded). + --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. + --governance-action-tx-id TXID + Previous txid of the governance action. + --governance-action-index WORD32 + Previous tx's governance action index. --min-fee-constant LOVELACE The constant factor for the minimum fee calculation. --min-fee-linear LOVELACE diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_deregistration-certificate.cli index 58d68cffdb..8b46c7ce49 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_stake-address_deregistration-certificate.cli @@ -4,7 +4,7 @@ Usage: cardano-cli conway stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] + --key-reg-deposit-amt NATURAL --out-file FILE Create a stake address deregistration certificate diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance.cli index 33370ccc94..9833a1a374 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance.cli @@ -1,5 +1,6 @@ Usage: cardano-cli latest governance ( create-mir-certificate + | action | create-poll | answer-poll | verify-poll @@ -13,6 +14,7 @@ Available options: Available commands: create-mir-certificate Create an MIR (Move Instantaneous Rewards) certificate + action Governance action commands. create-poll Create an SPO poll answer-poll Answer an SPO poll verify-poll Verify an answer to a given SPO poll diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..eda9bf45b9 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,95 @@ +Usage: cardano-cli latest governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--price-execution-steps RATIONAL + --price-execution-memory RATIONAL] + [--max-tx-execution-units (INT, INT)] + [--max-block-execution-units (INT, INT)] + [--max-value-size INT] + [--collateral-percent INT] + [--max-collateral-inputs INT] + [--utxo-cost-per-byte LOVELACE] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --price-execution-steps RATIONAL + Step price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --price-execution-memory RATIONAL + Memory price of execution units for script languages + that use them (from Alonzo era). (Examples: '1.1', + '11/10') + --max-tx-execution-units (INT, INT) + Max total script execution resources units allowed + per tx (from Alonzo era). They are denominated as + follows (steps, memory). + --max-block-execution-units (INT, INT) + Max total script execution resources units allowed + per block (from Alonzo era). They are denominated as + follows (steps, memory). + --max-value-size INT Max size of a multi-asset value in a tx output (from + Alonzo era). + --collateral-percent INT The percentage of the script contribution to the + txfee that must be provided as collateral inputs when + including Plutus scripts (from Alonzo era). + --max-collateral-inputs INT + The maximum number of collateral inputs allowed in a + transaction (from Alonzo era). + --utxo-cost-per-byte LOVELACE + Cost in lovelace per unit of UTxO storage (from + Babbage era). + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_deregistration-certificate.cli index d349a973ad..cd5c510ba4 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli latest stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance.cli index e1ad00c09d..e280dae811 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance.cli @@ -1,6 +1,7 @@ Usage: cardano-cli mary governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -13,3 +14,4 @@ Available commands: certificate create-genesis-key-delegation-certificate Create a genesis key delegation certificate + action Governance action commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..9f7e33fe42 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,71 @@ +Usage: cardano-cli mary governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --min-utxo-value NATURAL The minimum allowed UTxO value (Shelley to Mary + eras). + --extra-entropy HEX Praos extra entropy seed, as a hex byte string. + --reset-extra-entropy Reset the Praos extra entropy to none. + --decentralization-parameter RATIONAL + Decentralization parameter. + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_stake-address_deregistration-certificate.cli index b9858c2bae..413b6c5bb5 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli mary stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance.cli index 935c436cc2..78221f4428 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance.cli @@ -1,6 +1,7 @@ Usage: cardano-cli shelley governance ( create-mir-certificate | create-genesis-key-delegation-certificate + | action ) Governance commands. @@ -13,3 +14,4 @@ Available commands: certificate create-genesis-key-delegation-certificate Create a genesis key delegation certificate + action Governance action commands. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli new file mode 100644 index 0000000000..4c23ffd101 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli @@ -0,0 +1,71 @@ +Usage: cardano-cli shelley governance action create-protocol-parameters-update --epoch NATURAL + [--genesis-verification-key-file FILE] + [--min-fee-constant LOVELACE] + [--min-fee-linear LOVELACE] + [--max-block-body-size NATURAL] + [--max-tx-size NATURAL] + [--max-block-header-size NATURAL] + [--key-reg-deposit-amt NATURAL] + [--pool-reg-deposit NATURAL] + [--pool-retirement-epoch-boundary EPOCH_BOUNDARY] + [--number-of-pools NATURAL] + [--pool-influence RATIONAL] + [--treasury-expansion RATIONAL] + [--monetary-expansion RATIONAL] + [--protocol-major-version NATURAL + --protocol-minor-version NATURAL] + [--min-pool-cost NATURAL] + [--min-utxo-value NATURAL] + [ --extra-entropy HEX + | --reset-extra-entropy + ] + [--decentralization-parameter RATIONAL] + --out-file FILE + + Create a protocol parameters update. + +Available options: + --epoch NATURAL The epoch number in which the update proposal is + valid. + --genesis-verification-key-file FILE + Filepath of the genesis verification key. + --min-fee-constant LOVELACE + The constant factor for the minimum fee calculation. + --min-fee-linear LOVELACE + The linear factor per byte for the minimum fee + calculation. + --max-block-body-size NATURAL + Maximal block body size. + --max-tx-size NATURAL Maximum transaction size. + --max-block-header-size NATURAL + Maximum block header size. + --key-reg-deposit-amt NATURAL + Key registration deposit amount. + --pool-reg-deposit NATURAL + The amount of a pool registration deposit. + --pool-retirement-epoch-boundary EPOCH_BOUNDARY + Epoch bound on pool retirement. + --number-of-pools NATURAL + Desired number of pools. + --pool-influence RATIONAL + Pool influence. + --treasury-expansion RATIONAL + Treasury expansion. + --monetary-expansion RATIONAL + Monetary expansion. + --protocol-major-version NATURAL + Major protocol version. An increase indicates a hard + fork. + --protocol-minor-version NATURAL + Minor protocol version. An increase indicates a soft + fork (old software canvalidate but not produce new + blocks). + --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. + --min-utxo-value NATURAL The minimum allowed UTxO value (Shelley to Mary + eras). + --extra-entropy HEX Praos extra entropy seed, as a hex byte string. + --reset-extra-entropy Reset the Praos extra entropy to none. + --decentralization-parameter RATIONAL + Decentralization parameter. + --out-file FILE The output file. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_stake-address_deregistration-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_stake-address_deregistration-certificate.cli index d539f2d39e..23c669dae6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_stake-address_deregistration-certificate.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_stake-address_deregistration-certificate.cli @@ -4,7 +4,6 @@ Usage: cardano-cli shelley stake-address deregistration-certificate | --stake-script-file FILE | --stake-address ADDRESS ) - [--key-reg-deposit-amt NATURAL] --out-file FILE Create a stake address deregistration certificate @@ -16,7 +15,5 @@ Available options: Filepath of the staking verification key. --stake-script-file FILE Filepath of the staking script. --stake-address ADDRESS Target stake address (bech32 format). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. --out-file FILE The output file. -h,--help Show this help text From 41c10221fff625c95f5ce426460882b097cb8d7e Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Tue, 24 Oct 2023 12:05:17 -0400 Subject: [PATCH 4/4] Review fixes --- .../EraBased/Commands/Governance/Actions.hs | 19 +++++++++---------- .../EraBased/Options/Governance/Actions.hs | 9 +++++---- .../CLI/EraBased/Run/Governance/Actions.hs | 13 ++++++------- .../cardano-cli-golden/files/golden/help.cli | 12 ++++++------ ...tion_create-protocol-parameters-update.cli | 2 +- ...tion_create-protocol-parameters-update.cli | 2 +- ...tion_create-protocol-parameters-update.cli | 2 +- ...tion_create-protocol-parameters-update.cli | 2 +- ...tion_create-protocol-parameters-update.cli | 2 +- ...tion_create-protocol-parameters-update.cli | 2 +- 10 files changed, 32 insertions(+), 33 deletions(-) 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 73cad03401..f1940cddd6 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Governance/Actions.hs @@ -36,9 +36,7 @@ data GovernanceActionCmds era = GovernanceActionCreateConstitutionCmd !(GovernanceActionCreateConstitutionCmdArgs era) | GoveranceActionUpdateCommitteeCmd !(GoveranceActionUpdateCommitteeCmdArgs era) | GovernanceActionCreateNoConfidenceCmd !(GovernanceActionCreateNoConfidenceCmdArgs era) - | GovernanceActionProtocolParametersUpdateCmd - (ShelleyBasedEra era) - !(GovernanceActionProtocolParametersUpdateCmdArgs era) + | GovernanceActionProtocolParametersUpdateCmd !(GovernanceActionProtocolParametersUpdateCmdArgs era) | GovernanceActionTreasuryWithdrawalCmd !(GovernanceActionTreasuryWithdrawalCmdArgs era) | GovernanceActionInfoCmd !(GovernanceActionInfoCmdArgs era) | GovernanceActionViewCmd !(GovernanceActionViewCmdArgs era) @@ -100,10 +98,11 @@ data GovernanceActionCreateNoConfidenceCmdArgs era data GovernanceActionProtocolParametersUpdateCmdArgs era = GovernanceActionProtocolParametersUpdateCmdArgs - { uppPreConway :: Maybe (UpdateProtocolParametersPreConway era) - , uppConwayOnwards :: Maybe (UpdateProtocolParametersConwayOnwards era) - , uppNewPParams :: EraBasedProtocolParametersUpdate era - , uppFilePath :: File () Out + { uppShelleyBasedEra :: !(ShelleyBasedEra era) + , uppPreConway :: !(Maybe (UpdateProtocolParametersPreConway era)) + , uppConwayOnwards :: !(Maybe (UpdateProtocolParametersConwayOnwards era)) + , uppNewPParams :: !(EraBasedProtocolParametersUpdate era) + , uppFilePath :: !(File () Out) } deriving Show data GovernanceActionTreasuryWithdrawalCmdArgs era @@ -141,9 +140,9 @@ deriving instance Show (UpdateProtocolParametersConwayOnwards era) data UpdateProtocolParametersPreConway era = UpdateProtocolParametersPreConway - { eon :: ShelleyToBabbageEra era - , expiryEpoch :: EpochNo - , genesisVerificationKeys :: [VerificationKeyFile In] + { eon :: !(ShelleyToBabbageEra era) + , expiryEpoch :: !EpochNo + , genesisVerificationKeys :: ![VerificationKeyFile In] } 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 e7d3fbc61f..5dda84071a 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -184,7 +184,7 @@ pUpdateProtocolParametersCmd = let sbe = shelleyToBabbageEraToShelleyBasedEra shelleyToBab in subParser "create-protocol-parameters-update" $ Opt.info - ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs + ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs (shelleyToBabbageEraToShelleyBasedEra shelleyToBab) <$> fmap Just (pUpdateProtocolParametersPreConway shelleyToBab) <*> pure Nothing <*> dpGovActionProtocolParametersUpdate sbe @@ -195,7 +195,8 @@ pUpdateProtocolParametersCmd = let sbe = conwayEraOnwardsToShelleyBasedEra conwayOnwards in subParser "create-protocol-parameters-update" $ Opt.info - ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs Nothing + ( Cmd.GovernanceActionProtocolParametersUpdateCmdArgs + (conwayEraOnwardsToShelleyBasedEra conwayOnwards) Nothing <$> fmap Just (pUpdateProtocolParametersPostConway conwayOnwards) <*> dpGovActionProtocolParametersUpdate sbe <*> pOutputFile @@ -209,7 +210,7 @@ pGovernanceActionProtocolParametersUpdateCmd :: () -> Maybe (Parser (Cmd.GovernanceActionCmds era)) pGovernanceActionProtocolParametersUpdateCmd era = do w <- forEraMaybeEon era - pure $ Cmd.GovernanceActionProtocolParametersUpdateCmd w + pure $ Cmd.GovernanceActionProtocolParametersUpdateCmd <$> pUpdateProtocolParametersCmd w @@ -298,7 +299,7 @@ pIntroducedInConwayPParams = -- Not necessary in Conway era onwards pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In] -pProtocolParametersUpdateGenesisKeys = many pGenesisVerificationKeyFile +pProtocolParametersUpdateGenesisKeys = some pGenesisVerificationKeyFile dpGovActionProtocolParametersUpdate :: ShelleyBasedEra era -> Parser (EraBasedProtocolParametersUpdate era) 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 44c98fcde9..4c64465f87 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Actions.hs @@ -38,8 +38,8 @@ runGovernanceActionCmds = \case GovernanceActionCreateConstitutionCmd args -> runGovernanceActionCreateConstitutionCmd args - GovernanceActionProtocolParametersUpdateCmd sbe args -> - runGovernanceActionCreateProtocolParametersUpdateCmd sbe args + GovernanceActionProtocolParametersUpdateCmd args -> + runGovernanceActionCreateProtocolParametersUpdateCmd args GovernanceActionTreasuryWithdrawalCmd args -> runGovernanceActionTreasuryWithdrawalCmd args @@ -244,10 +244,10 @@ runGovernanceActionCreateNewCommitteeCmd $ writeFileTextEnvelope outFile Nothing proposal runGovernanceActionCreateProtocolParametersUpdateCmd :: () - => ShelleyBasedEra era - -> Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era + => Cmd.GovernanceActionProtocolParametersUpdateCmdArgs era -> ExceptT GovernanceActionsError IO () -runGovernanceActionCreateProtocolParametersUpdateCmd sbe eraBasedPParams' = do +runGovernanceActionCreateProtocolParametersUpdateCmd eraBasedPParams' = do + let sbe = uppShelleyBasedEra eraBasedPParams' caseShelleyToBabbageOrConwayEraOnwards (\sToB -> do let oFp = uppFilePath eraBasedPParams' @@ -285,14 +285,13 @@ runGovernanceActionCreateProtocolParametersUpdateCmd sbe eraBasedPParams' = do let eraBasedPParams = uppNewPParams eraBasedPParams' updateProtocolParams = createEraBasedProtocolParamUpdate sbe eraBasedPParams - apiUpdateProtocolParamsType = fromLedgerPParamsUpdate sbe updateProtocolParams prevGovActId = Ledger.maybeToStrictMaybe $ uncurry createPreviousGovernanceActionId <$> mPrevGovActId proposalAnchor = Ledger.Anchor { Ledger.anchorUrl = unProposalUrl proposalUrl , Ledger.anchorDataHash = proposalHash } - govAct = UpdatePParams prevGovActId apiUpdateProtocolParamsType + govAct = UpdatePParams prevGovActId updateProtocolParams let proposalProcedure = createProposalProcedure sbe network deposit returnKeyHash govAct proposalAnchor 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 a79d1bf73a..b5551727d1 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -328,7 +328,7 @@ Usage: cardano-cli shelley governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli shelley governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -1519,7 +1519,7 @@ Usage: cardano-cli allegra governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli allegra governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -2708,7 +2708,7 @@ Usage: cardano-cli mary governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli mary governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -3874,7 +3874,7 @@ Usage: cardano-cli alonzo governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli alonzo governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -5056,7 +5056,7 @@ Usage: cardano-cli babbage governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli babbage governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] @@ -7831,7 +7831,7 @@ Usage: cardano-cli latest governance action create-protocol-parameters-update Governance action commands. Usage: cardano-cli latest governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli index c3dcd58ba7..4579b21872 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli allegra governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli index b1a0d2795f..0326dde3bc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli alonzo governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli index 92073b2c2d..80dbc48fc9 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli babbage governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli index eda9bf45b9..79b3732baa 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli latest governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli index 9f7e33fe42..54eb7d40e4 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli mary governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli index 4c23ffd101..b0ee7db6cc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_governance_action_create-protocol-parameters-update.cli @@ -1,5 +1,5 @@ Usage: cardano-cli shelley governance action create-protocol-parameters-update --epoch NATURAL - [--genesis-verification-key-file FILE] + (--genesis-verification-key-file FILE) [--min-fee-constant LOVELACE] [--min-fee-linear LOVELACE] [--max-block-body-size NATURAL]