From 5b96ece4d721a8a8d94762e56b8cdef615603a6b Mon Sep 17 00:00:00 2001 From: Carl Hammann Date: Tue, 17 Oct 2023 14:11:46 +0200 Subject: [PATCH 1/2] Disambiguate treasury withdrawals --- .../EraBased/Options/Governance/Actions.hs | 4 +- .../cardano-cli-golden/files/golden/help.cli | 24 ++++----- ...ance_action_create-treasury-withdrawal.cli | 50 ++++++++++--------- 3 files changed, 40 insertions(+), 38 deletions(-) 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 0e93b0cb6f..f527dd7952 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -314,10 +314,10 @@ pGovernanceActionTreasuryWithdrawalCmd era = do Cmd.GovernanceActionTreasuryWithdrawalCmdArgs eon <$> pNetwork <*> pGovActionDeposit - <*> pAnyStakeIdentifier Nothing + <*> pAnyStakeIdentifier (Just "deposit-return") <*> pProposalUrl <*> pProposalHashSource - <*> many ((,) <$> pAnyStakeIdentifier Nothing <*> pTransferAmt) -- TODO we should likely pass a prefix here, becaus pAnyStakeIdentiefier is used twice + <*> many ((,) <$> pAnyStakeIdentifier (Just "funds-receiving") <*> pTransferAmt) <*> pFileOutDirection "out-file" "Output filepath of the treasury withdrawal." ) $ Opt.progDesc "Create a treasury withdrawal." 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 4fc4357911..773c2dbdb3 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -6213,12 +6213,12 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --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 + ( --deposit-return-stake-pool-verification-key STRING + | --deposit-return-cold-verification-key-file FILE + | --deposit-return-stake-pool-id STAKE_POOL_ID + | --deposit-return-stake-verification-key STRING + | --deposit-return-stake-verification-key-file FILE + | --deposit-return-stake-key-hash HASH ) --proposal-anchor-url TEXT ( --proposal-anchor-metadata TEXT @@ -6226,12 +6226,12 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --proposal-anchor-metadata-hash HASH ) [ - ( --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 + ( --funds-receiving-stake-pool-verification-key STRING + | --funds-receiving-cold-verification-key-file FILE + | --funds-receiving-stake-pool-id STAKE_POOL_ID + | --funds-receiving-stake-verification-key STRING + | --funds-receiving-stake-verification-key-file FILE + | --funds-receiving-stake-key-hash HASH ) --transfer LOVELACE] --out-file FILE diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli index bb049c0811..7a42d97aba 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_governance_action_create-treasury-withdrawal.cli @@ -3,12 +3,12 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --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 + ( --deposit-return-stake-pool-verification-key STRING + | --deposit-return-cold-verification-key-file FILE + | --deposit-return-stake-pool-id STAKE_POOL_ID + | --deposit-return-stake-verification-key STRING + | --deposit-return-stake-verification-key-file FILE + | --deposit-return-stake-key-hash HASH ) --proposal-anchor-url TEXT ( --proposal-anchor-metadata TEXT @@ -16,12 +16,12 @@ Usage: cardano-cli conway governance action create-treasury-withdrawal | --proposal-anchor-metadata-hash HASH ) [ - ( --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 + ( --funds-receiving-stake-pool-verification-key STRING + | --funds-receiving-cold-verification-key-file FILE + | --funds-receiving-stake-pool-id STAKE_POOL_ID + | --funds-receiving-stake-verification-key STRING + | --funds-receiving-stake-verification-key-file FILE + | --funds-receiving-stake-key-hash HASH ) --transfer LOVELACE] --out-file FILE @@ -33,19 +33,20 @@ Available options: --testnet Use the testnet magic id. --governance-action-deposit NATURAL Deposit required to submit a governance action. - --stake-pool-verification-key STRING + --deposit-return-stake-pool-verification-key STRING Stake pool verification key (Bech32 or hex-encoded). - --cold-verification-key-file FILE + --deposit-return-cold-verification-key-file FILE Filepath of the stake pool verification key. - --stake-pool-id STAKE_POOL_ID + --deposit-return-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 + --deposit-return-stake-verification-key STRING Stake verification key (Bech32 or hex-encoded). - --stake-verification-key-file FILE + --deposit-return-stake-verification-key-file FILE Filepath of the staking verification key. - --stake-key-hash HASH Stake verification key hash (hex-encoded). + --deposit-return-stake-key-hash HASH + Stake verification key hash (hex-encoded). --proposal-anchor-url TEXT Proposal anchor URL --proposal-anchor-metadata TEXT @@ -54,19 +55,20 @@ Available options: Proposal anchor contents as a text file. --proposal-anchor-metadata-hash HASH Proposal anchor data hash. - --stake-pool-verification-key STRING + --funds-receiving-stake-pool-verification-key STRING Stake pool verification key (Bech32 or hex-encoded). - --cold-verification-key-file FILE + --funds-receiving-cold-verification-key-file FILE Filepath of the stake pool verification key. - --stake-pool-id STAKE_POOL_ID + --funds-receiving-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 + --funds-receiving-stake-verification-key STRING Stake verification key (Bech32 or hex-encoded). - --stake-verification-key-file FILE + --funds-receiving-stake-verification-key-file FILE Filepath of the staking verification key. - --stake-key-hash HASH Stake verification key hash (hex-encoded). + --funds-receiving-stake-key-hash HASH + Stake verification key hash (hex-encoded). --transfer LOVELACE The amount to transfer. --out-file FILE Output filepath of the treasury withdrawal. -h,--help Show this help text From 76e01640ec334815c283aed4c36eb58ea307d287 Mon Sep 17 00:00:00 2001 From: Carl Hammann Date: Tue, 17 Oct 2023 14:12:20 +0200 Subject: [PATCH 2/2] Delete unused golden files --- .../help/allegra_query_constitution-hash.cli | 34 ------------------- .../help/alonzo_query_constitution-hash.cli | 34 ------------------- .../help/babbage_query_constitution-hash.cli | 34 ------------------- .../help/conway_query_constitution-hash.cli | 34 ------------------- .../help/latest_query_constitution-hash.cli | 34 ------------------- .../help/mary_query_constitution-hash.cli | 34 ------------------- .../help/shelley_query_constitution-hash.cli | 34 ------------------- 7 files changed, 238 deletions(-) delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_constitution-hash.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_constitution-hash.cli diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_constitution-hash.cli deleted file mode 100644 index 0e66ebdf2c..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli allegra query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_constitution-hash.cli deleted file mode 100644 index 67a9c840e2..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli alonzo query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_constitution-hash.cli deleted file mode 100644 index 5ed9f4fe7c..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli babbage query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_constitution-hash.cli deleted file mode 100644 index ed230fe41e..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli conway query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_constitution-hash.cli deleted file mode 100644 index 681df8292e..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli latest query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_constitution-hash.cli deleted file mode 100644 index cf60114a8b..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli mary query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_constitution-hash.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_constitution-hash.cli deleted file mode 100644 index f9fef3d1d2..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_query_constitution-hash.cli +++ /dev/null @@ -1,34 +0,0 @@ -Usage: cardano-cli shelley query constitution-hash --socket-path SOCKET_PATH - [ --shelley-mode - | --byron-mode - [--epoch-slots SLOTS] - | --cardano-mode - [--epoch-slots SLOTS] - ] - ( --mainnet - | --testnet-magic NATURAL - ) - [--out-file FILE] - - Get the constitution hash - -Available options: - --socket-path SOCKET_PATH - Path to the node socket. This overrides the - CARDANO_NODE_SOCKET_PATH environment variable. The - argument is optional if CARDANO_NODE_SOCKET_PATH is - defined and mandatory otherwise. - --shelley-mode For talking to a node running in Shelley-only mode. - --byron-mode For talking to a node running in Byron-only mode. - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --cardano-mode For talking to a node running in full Cardano mode - (default). - --epoch-slots SLOTS The number of slots per epoch for the Byron era. - (default: 21600) - --mainnet Use the mainnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --testnet-magic NATURAL Specify a testnet magic id. This overrides the - CARDANO_NODE_NETWORK_ID environment variable - --out-file FILE Optional output file. Default is to write to stdout. - -h,--help Show this help text