diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Option.hs b/cardano-cli/src/Cardano/CLI/Legacy/Option.hs index c939f10880..ca8ccd318d 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Option.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Option.hs @@ -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) @@ -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 diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/GenesisKeyDelegation.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/GenesisKeyDelegation.hs index bd75319c99..b889de30d0 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/GenesisKeyDelegation.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Shelley/TextEnvelope/Certificates/GenesisKeyDelegation.hs @@ -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" 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 132bccd2a9..2c959dd939 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -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 diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance.cli deleted file mode 100644 index 1ac6d67f4c..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance.cli +++ /dev/null @@ -1,17 +0,0 @@ -Usage: cardano-cli legacy governance - ( create-mir-certificate - | create-genesis-key-delegation-certificate - | create-update-proposal - ) - - Governance commands - -Available options: - -h,--help Show this help text - -Available commands: - create-mir-certificate Create an MIR (Move Instantaneous Rewards) - certificate - create-genesis-key-delegation-certificate - Create a genesis key delegation certificate - create-update-proposal Create an update proposal diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-genesis-key-delegation-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-genesis-key-delegation-certificate.cli deleted file mode 100644 index dbeb66fecd..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-genesis-key-delegation-certificate.cli +++ /dev/null @@ -1,54 +0,0 @@ -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 - -Available options: - --shelley-era Specify the Shelley era - DEPRECATED - will be - removed in the future - --allegra-era Specify the Allegra era - DEPRECATED - will be - removed in the future - --mary-era Specify the Mary era - DEPRECATED - will be removed - in the future - --alonzo-era Specify the Alonzo era - DEPRECATED - will be removed - in the future - --babbage-era Specify the Babbage era (default) - DEPRECATED - will - be removed in the future - --genesis-verification-key STRING - Genesis verification key (hex-encoded). - --genesis-verification-key-file FILEPATH - Filepath of the genesis verification key. - --genesis-verification-key-hash STRING - Genesis verification key hash (hex-encoded). - --genesis-delegate-verification-key STRING - Genesis delegate verification key (hex-encoded). - --genesis-delegate-verification-key-file FILEPATH - Filepath of the genesis delegate verification key. - --genesis-delegate-verification-key-hash STRING - Genesis delegate verification key hash (hex-encoded). - --vrf-verification-key STRING - VRF verification key (Bech32 or hex-encoded). - --vrf-verification-key-file FILEPATH - Filepath of the VRF verification key. - --vrf-verification-key-hash STRING - VRF verification key hash (hex-encoded). - --out-file FILEPATH The output file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate.cli deleted file mode 100644 index a37df5df5b..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate.cli +++ /dev/null @@ -1,44 +0,0 @@ -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 - -Available options: - --shelley-era Specify the Shelley era - DEPRECATED - will be - removed in the future - --allegra-era Specify the Allegra era - DEPRECATED - will be - removed in the future - --mary-era Specify the Mary era - DEPRECATED - will be removed - in the future - --alonzo-era Specify the Alonzo era - DEPRECATED - will be removed - in the future - --babbage-era Specify the Babbage era (default) - DEPRECATED - will - be removed in the future - --reserves Use the reserves pot. - --treasury Use the treasury pot. - --stake-address ADDRESS Target stake address (bech32 format). - --reward LOVELACE The reward for the relevant reward account. - --out-file FILEPATH The output file. - -h,--help Show this help text - -Available commands: - stake-addresses Create an MIR certificate to pay stake addresses - transfer-to-treasury Create an MIR certificate to transfer from the - reserves pot to the treasury pot - transfer-to-rewards Create an MIR certificate to transfer from the - treasury pot to the reserves pot diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_stake-addresses.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_stake-addresses.cli deleted file mode 100644 index 7b7f946fdf..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_stake-addresses.cli +++ /dev/null @@ -1,33 +0,0 @@ -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 - -Available options: - --shelley-era Specify the Shelley era - DEPRECATED - will be - removed in the future - --allegra-era Specify the Allegra era - DEPRECATED - will be - removed in the future - --mary-era Specify the Mary era - DEPRECATED - will be removed - in the future - --alonzo-era Specify the Alonzo era - DEPRECATED - will be removed - in the future - --babbage-era Specify the Babbage era (default) - DEPRECATED - will - be removed in the future - --reserves Use the reserves pot. - --treasury Use the treasury pot. - --stake-address ADDRESS Target stake address (bech32 format). - --reward LOVELACE The reward for the relevant reward account. - --out-file FILEPATH The output file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-rewards.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-rewards.cli deleted file mode 100644 index 9913b48c69..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-rewards.cli +++ /dev/null @@ -1,27 +0,0 @@ -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 - -Available options: - --shelley-era Specify the Shelley era - DEPRECATED - will be - removed in the future - --allegra-era Specify the Allegra era - DEPRECATED - will be - removed in the future - --mary-era Specify the Mary era - DEPRECATED - will be removed - in the future - --alonzo-era Specify the Alonzo era - DEPRECATED - will be removed - in the future - --babbage-era Specify the Babbage era (default) - DEPRECATED - will - be removed in the future - --transfer LOVELACE The amount to transfer. - --out-file FILEPATH The output file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-treasury.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-treasury.cli deleted file mode 100644 index b3b9b687ee..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-mir-certificate_transfer-to-treasury.cli +++ /dev/null @@ -1,27 +0,0 @@ -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 - -Available options: - --shelley-era Specify the Shelley era - DEPRECATED - will be - removed in the future - --allegra-era Specify the Allegra era - DEPRECATED - will be - removed in the future - --mary-era Specify the Mary era - DEPRECATED - will be removed - in the future - --alonzo-era Specify the Alonzo era - DEPRECATED - will be removed - in the future - --babbage-era Specify the Babbage era (default) - DEPRECATED - will - be removed in the future - --transfer LOVELACE The amount to transfer. - --out-file FILEPATH The output file. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-update-proposal.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-update-proposal.cli deleted file mode 100644 index 98e8309cd7..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/legacy_governance_create-update-proposal.cli +++ /dev/null @@ -1,110 +0,0 @@ -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 - -Available options: - --out-file FILEPATH The output file. - --epoch NATURAL The epoch number in which the update proposal is - valid. - --genesis-verification-key-file FILEPATH - Filepath of the genesis verification key. - --protocol-major-version MAJOR - Specify the major protocol version to fork into. An - increase indicates a hard fork. It must be the next - natural number after the current version and must be - supported by the node. - --protocol-minor-version MINOR - Minor protocol version. An increase indicates a soft - fork (old software can validate but not produce new - blocks). Must be zero when the major protocol version - is increased. - --decentralization-parameter RATIONAL - Decentralization parameter. - --extra-entropy HEX Praos extra entropy seed, as a hex byte string. - --reset-extra-entropy Reset the Praos extra entropy to none. - --max-block-header-size WORD16 - Maximum block header size. - --max-block-body-size WORD32 - Maximal block body size. - --max-tx-size WORD32 Maximum transaction size. - --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. - --min-utxo-value NATURAL The minimum allowed UTxO value (Shelley to Mary - eras). - --key-reg-deposit-amt NATURAL - Key registration deposit amount. - --pool-reg-deposit NATURAL - The amount of a pool registration deposit. - --min-pool-cost NATURAL The minimum allowed cost parameter for stake pools. - --pool-retirement-epoch-interval WORD32 - Epoch interval of pool retirement. - --number-of-pools WORD16 Desired number of pools. - --pool-influence RATIONAL - Pool influence. - --monetary-expansion RATIONAL - Monetary expansion. - --treasury-expansion RATIONAL - Treasury expansion. - --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). - --cost-model-file FILE Filepath of the JSON formatted cost model - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-test/Test/Cli/Compatible/Transaction/Build.hs b/cardano-cli/test/cardano-cli-test/Test/Cli/Compatible/Transaction/Build.hs index 6a90800154..f3ea83eb13 100644 --- a/cardano-cli/test/cardano-cli-test/Test/Cli/Compatible/Transaction/Build.hs +++ b/cardano-cli/test/cardano-cli-test/Test/Cli/Compatible/Transaction/Build.hs @@ -96,9 +96,11 @@ hprop_compatible_shelley_create_update_proposal = -- reference transaction _ <- execCardanoCLI $ - [ "legacy" + [ "compatible" + , "allegra" , "governance" - , "create-update-proposal" + , "action" + , "create-protocol-parameters-update" ] <> args <> [ "--out-file"