Skip to content

Remove legacy governance command group #1194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions cardano-cli/src/Cardano/CLI/Legacy/Option.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import Cardano.CLI.Environment
import Cardano.CLI.EraBased.Common.Option
import Cardano.CLI.Legacy.Command
import Cardano.CLI.Legacy.Genesis.Command
import Cardano.CLI.Legacy.Governance.Command
import Cardano.CLI.Parser
import Cardano.CLI.Type.Common
import Cardano.Ledger.BaseTypes (NonZero, knownNonZeroBounded)
Expand All @@ -52,86 +51,8 @@ parseLegacyCmds envCli =
, Opt.command "genesis" $
Opt.info (LegacyGenesisCmds <$> pGenesisCmds envCli) $
Opt.progDesc "Genesis block commands"
, Opt.command "governance" $
Opt.info (LegacyGovernanceCmds <$> pGovernanceCmds envCli) $
Opt.progDesc "Governance commands"
]

pGovernanceCmds :: EnvCli -> Parser LegacyGovernanceCmds
pGovernanceCmds envCli =
asum
[ Opt.hsubparser $
commandWithMetavar "create-mir-certificate" $
Opt.info (pLegacyMIRPayStakeAddresses <|> mirCertParsers) $
Opt.progDesc "Create an MIR (Move Instantaneous Rewards) certificate"
, Opt.hsubparser $
commandWithMetavar "create-genesis-key-delegation-certificate" $
Opt.info pGovernanceGenesisKeyDelegationCertificate $
Opt.progDesc "Create a genesis key delegation certificate"
, Opt.hsubparser $
commandWithMetavar "create-update-proposal" $
Opt.info pUpdateProposal $
Opt.progDesc "Create an update proposal"
]
where
mirCertParsers :: Parser LegacyGovernanceCmds
mirCertParsers =
asum
[ Opt.hsubparser $
commandWithMetavar "stake-addresses" $
Opt.info pLegacyMIRPayStakeAddresses $
Opt.progDesc "Create an MIR certificate to pay stake addresses"
, Opt.hsubparser $
commandWithMetavar "transfer-to-treasury" $
Opt.info pLegacyMIRTransferToTreasury $
Opt.progDesc "Create an MIR certificate to transfer from the reserves pot to the treasury pot"
, Opt.hsubparser $
commandWithMetavar "transfer-to-rewards" $
Opt.info pLegacyMIRTransferToReserves $
Opt.progDesc "Create an MIR certificate to transfer from the treasury pot to the reserves pot"
]

pLegacyMIRPayStakeAddresses :: Parser LegacyGovernanceCmds
pLegacyMIRPayStakeAddresses =
GovernanceCreateMirCertificateStakeAddressesCmd
<$> pAnyShelleyToBabbageEra envCli
<*> pMIRPot
<*> some (pStakeAddress Nothing)
<*> some pRewardAmt
<*> pOutputFile

pLegacyMIRTransferToTreasury :: Parser LegacyGovernanceCmds
pLegacyMIRTransferToTreasury =
GovernanceCreateMirCertificateTransferToTreasuryCmd
<$> pAnyShelleyToBabbageEra envCli
<*> pTransferAmt
<*> pOutputFile

pLegacyMIRTransferToReserves :: Parser LegacyGovernanceCmds
pLegacyMIRTransferToReserves =
GovernanceCreateMirCertificateTransferToReservesCmd
<$> pAnyShelleyToBabbageEra envCli
<*> pTransferAmt
<*> pOutputFile

pGovernanceGenesisKeyDelegationCertificate :: Parser LegacyGovernanceCmds
pGovernanceGenesisKeyDelegationCertificate =
GovernanceGenesisKeyDelegationCertificate
<$> pAnyShelleyToBabbageEra envCli
<*> pGenesisVerificationKeyOrHashOrFile
<*> pGenesisDelegateVerificationKeyOrHashOrFile
<*> pVrfVerificationKeyOrHashOrFile
<*> pOutputFile

pUpdateProposal :: Parser LegacyGovernanceCmds
pUpdateProposal =
GovernanceUpdateProposal
<$> pOutputFile
<*> pEpochNoUpdateProp
<*> some pGenesisVerificationKeyFile
<*> pProtocolParametersUpdate
<*> optional pCostModels

pGenesisCmds :: EnvCli -> Parser LegacyGenesisCmds
pGenesisCmds envCli =
asum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ hprop_golden_shelleyGenesisKeyDelegationCertificate =
-- Create genesis key delegation certificate
void $
execCardanoCLI
[ "legacy"
[ "compatible"
, "babbage"
, "governance"
, "create-genesis-key-delegation-certificate"
, "--babbage-era"
, "--genesis-verification-key-file"
, genesisVerKeyFilePath
, "--genesis-delegate-verification-key-file"
Expand Down
128 changes: 0 additions & 128 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -524,134 +524,6 @@ Usage: cardano-cli legacy Legacy commands

Legacy commands

Usage: cardano-cli legacy governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
| create-update-proposal
)

Governance commands

Usage: cardano-cli legacy governance create-mir-certificate
( [ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
( --reserves
| --treasury
)
(--stake-address ADDRESS)
(--reward LOVELACE)
--out-file FILEPATH
| stake-addresses
| transfer-to-treasury
| transfer-to-rewards
)

Create an MIR (Move Instantaneous Rewards) certificate

Usage: cardano-cli legacy governance create-mir-certificate stake-addresses
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
( --reserves
| --treasury
)
(--stake-address ADDRESS)
(--reward LOVELACE)
--out-file FILEPATH

Create an MIR certificate to pay stake addresses

Usage: cardano-cli legacy governance create-mir-certificate transfer-to-treasury
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
--transfer LOVELACE
--out-file FILEPATH

Create an MIR certificate to transfer from the reserves pot to the treasury
pot

Usage: cardano-cli legacy governance create-mir-certificate transfer-to-rewards
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
--transfer LOVELACE
--out-file FILEPATH

Create an MIR certificate to transfer from the treasury pot to the reserves
pot

Usage: cardano-cli legacy governance create-genesis-key-delegation-certificate
[ --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
( --genesis-verification-key STRING
| --genesis-verification-key-file FILEPATH
| --genesis-verification-key-hash STRING
)
( --genesis-delegate-verification-key STRING
| --genesis-delegate-verification-key-file FILEPATH
| --genesis-delegate-verification-key-hash STRING
)
( --vrf-verification-key STRING
| --vrf-verification-key-file FILEPATH
| --vrf-verification-key-hash STRING
)
--out-file FILEPATH

Create a genesis key delegation certificate

Usage: cardano-cli legacy governance create-update-proposal --out-file FILEPATH
--epoch NATURAL
(--genesis-verification-key-file FILEPATH)
[--protocol-major-version MAJOR
--protocol-minor-version MINOR]
[--decentralization-parameter RATIONAL]
[ --extra-entropy HEX
| --reset-extra-entropy
]
[--max-block-header-size WORD16]
[--max-block-body-size WORD32]
[--max-tx-size WORD32]
[--min-fee-constant LOVELACE]
[--min-fee-linear LOVELACE]
[--min-utxo-value NATURAL]
[--key-reg-deposit-amt NATURAL]
[--pool-reg-deposit NATURAL]
[--min-pool-cost NATURAL]
[--pool-retirement-epoch-interval WORD32]
[--number-of-pools WORD16]
[--pool-influence RATIONAL]
[--monetary-expansion RATIONAL]
[--treasury-expansion 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-byte LOVELACE]
[--cost-model-file FILE]

Create an update proposal

Usage: cardano-cli legacy genesis
( key-gen-genesis
| key-gen-delegate
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading