diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs index 6d2f674a0e..050ed4e0e5 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs @@ -14,6 +14,7 @@ import Cardano.CLI.Environment (EnvCli (..)) import Cardano.CLI.EraBased.Commands.Transaction import Cardano.CLI.EraBased.Options.Common import Cardano.CLI.Types.Common +import Cardano.CLI.Types.Governance (VoteFile) import Data.Foldable import Options.Applicative hiding (help, str) @@ -151,7 +152,7 @@ pTransactionBuildCmd era envCli = do ] ] where - pCmd :: ShelleyBasedEra era -> Parser (TransactionCmds era) + pCmd :: ShelleyBasedEra era -> Parser (TransactionCmds era) pCmd sbe = fmap TransactionBuildCmd $ TransactionBuildCmdArgs sbe @@ -180,8 +181,8 @@ pTransactionBuildCmd era envCli = do "Filepath of auxiliary script(s)") <*> many pMetadataFile <*> pFeatured (shelleyBasedToCardanoEra sbe) (optional pUpdateProposalFile) - <*> many (pFileInDirection "vote-file" "Filepath of the vote.") - <*> many (pFileInDirection "proposal-file" "Filepath of the proposal.") + <*> pVoteFiles sbe + <*> pProposalFiles sbe <*> (OutputTxBodyOnly <$> pTxBodyFileOut <|> pCalculatePlutusScriptCost) pChangeAddress :: Parser TxOutChangeAddress @@ -215,10 +216,20 @@ pTransactionBuildRaw era = <*> many pMetadataFile <*> optional pProtocolParamsFile <*> pFeatured era (optional pUpdateProposalFile) - <*> many (pFileInDirection "vote-file" "Filepath of the vote.") - <*> many (pFileInDirection "proposal-file" "Filepath of the proposal.") + <*> pVoteFiles era + <*> pProposalFiles era <*> pTxBodyFileOut +pVoteFiles :: ShelleyBasedEra era -> Parser [VoteFile In] +pVoteFiles = caseShelleyToBabbageOrConwayEraOnwards + (const $ pure []) + (const $ many (pFileInDirection "vote-file" "Filepath of the vote.")) + +pProposalFiles :: ShelleyBasedEra era -> Parser [ProposalFile In] +pProposalFiles = caseShelleyToBabbageOrConwayEraOnwards + (const $ pure []) + (const $ many (pFileInDirection "proposal-file" "Filepath of the proposal.")) + pTransactionSign :: EnvCli -> Parser (TransactionCmds era) pTransactionSign envCli = fmap TransactionSignCmd $ 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 8c2070c153..c3490d303b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -922,8 +922,6 @@ Usage: cardano-cli shelley transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -1047,8 +1045,6 @@ Usage: cardano-cli shelley transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -2085,8 +2081,6 @@ Usage: cardano-cli allegra transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -2210,8 +2204,6 @@ Usage: cardano-cli allegra transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -3240,8 +3232,6 @@ Usage: cardano-cli mary transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -3362,8 +3352,6 @@ Usage: cardano-cli mary transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -4396,8 +4384,6 @@ Usage: cardano-cli alonzo transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -4521,8 +4507,6 @@ Usage: cardano-cli alonzo transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -5585,8 +5569,6 @@ Usage: cardano-cli babbage transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -5710,8 +5692,6 @@ Usage: cardano-cli babbage transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -8280,8 +8260,6 @@ Usage: cardano-cli latest transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -8405,8 +8383,6 @@ Usage: cardano-cli latest transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build-raw.cli index a4dc77981a..e8fb60b493 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli allegra transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build.cli index 29f0295f89..3710891550 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_build.cli @@ -115,8 +115,6 @@ Usage: cardano-cli allegra transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -391,8 +389,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build-raw.cli index 4299ec829f..17afe0d58c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli alonzo transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build.cli index 501321155f..f4d8236372 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_build.cli @@ -115,8 +115,6 @@ Usage: cardano-cli alonzo transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -391,8 +389,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build-raw.cli index 492c413645..6dbaf209e3 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli babbage transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build.cli index cf8facd707..ea9fd6a970 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_build.cli @@ -115,8 +115,6 @@ Usage: cardano-cli babbage transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -391,8 +389,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build-raw.cli index 16089bff7a..8fa3ca7ac5 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli latest transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build.cli index 5d9f1c5039..385c74602f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_build.cli @@ -115,8 +115,6 @@ Usage: cardano-cli latest transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -391,8 +389,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build-raw.cli index 26c2f7d4cd..1ac4f3189d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli mary transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build.cli index af177efae9..3b38214e65 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_build.cli @@ -112,8 +112,6 @@ Usage: cardano-cli mary transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -388,8 +386,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build-raw.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build-raw.cli index d2ffe10642..88d168537a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build-raw.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build-raw.cli @@ -121,8 +121,6 @@ Usage: cardano-cli shelley transaction build-raw ] [--protocol-params-file FILE] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] --out-file FILE Build a transaction (low-level, inconvenient) @@ -398,7 +396,5 @@ Available options: Filepath of the JSON-encoded protocol parameters file --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build.cli index 5941127ced..124e5948f6 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_build.cli @@ -115,8 +115,6 @@ Usage: cardano-cli shelley transaction build --socket-path SOCKET_PATH | --metadata-cbor-file FILE ] [--update-proposal-file FILE] - [--vote-file FILE] - [--proposal-file FILE] ( --out-file FILE | --calculate-plutus-script-cost FILE ) @@ -391,8 +389,6 @@ Available options: Filepath of the metadata, in raw CBOR format. --update-proposal-file FILE Filepath of the update proposal. - --vote-file FILE Filepath of the vote. - --proposal-file FILE Filepath of the proposal. --out-file FILE Output filepath of the JSON TxBody. --calculate-plutus-script-cost FILE (File () Out) filepath of the script cost