From 811de9de9ddf740db0d7aa59bdaa33d2c5ab28ac Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Fri, 21 Jun 2024 15:42:15 +0200 Subject: [PATCH] Fix #796 - make --fee mandatory in legacy transaction build-raw --- cardano-cli/src/Cardano/CLI/Legacy/Commands/Transaction.hs | 2 +- cardano-cli/src/Cardano/CLI/Legacy/Options.hs | 2 +- cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Transaction.hs b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Transaction.hs index a4d1d06719..e41add55ce 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Commands/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Commands/Transaction.hs @@ -38,7 +38,7 @@ data LegacyTransactionCmds -- ^ Transaction lower bound (Maybe SlotNo) -- ^ Transaction upper bound - (Maybe Coin) + Coin -- ^ Tx fee [(CertificateFile, Maybe (ScriptWitnessFiles WitCtxStake))] -- ^ Certificates with potential script witness diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs index b3b2771452..277b0a9bd5 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Options.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Options.hs @@ -364,7 +364,7 @@ pTransaction envCli = <*> optional (pMintMultiAsset ManualBalance) <*> optional pInvalidBefore <*> optional pLegacyInvalidHereafter - <*> optional pTxFee + <*> pTxFee <*> many (pCertificateFile ManualBalance ) <*> many (pWithdrawal ManualBalance) <*> pTxMetadataJsonSchema diff --git a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs index ce417c3e78..5375cb058d 100644 --- a/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Legacy/Run/Transaction.hs @@ -22,7 +22,6 @@ import Cardano.CLI.Types.Errors.TxValidationError import Cardano.CLI.Types.Governance import Data.Function -import Data.Maybe runLegacyTransactionCmds :: LegacyTransactionCmds -> ExceptT TxCmdError IO () runLegacyTransactionCmds = \case @@ -135,7 +134,7 @@ runLegacyTransactionBuildRawCmd :: () -> Maybe (Value, [ScriptWitnessFiles WitCtxMint]) -- ^ Multi-Asset value with script witness -> Maybe SlotNo -- ^ Validity lower bound -> Maybe SlotNo -- ^ Validity upper bound - -> Maybe Coin -- ^ Tx fee + -> Coin -- ^ Tx fee -> [(CertificateFile, Maybe (ScriptWitnessFiles WitCtxStake))] -> [(StakeAddress, Coin, Maybe (ScriptWitnessFiles WitCtxStake))] -> TxMetadataJsonSchema @@ -176,7 +175,7 @@ runLegacyTransactionBuildRawCmd runTransactionBuildRawCmd ( Cmd.TransactionBuildRawCmdArgs sbe mScriptValidity txins readOnlyRefIns txinsc mReturnColl - mTotColl reqSigners txouts mValue mLowBound upperBound (fromMaybe 0 fee) certs wdrls + mTotColl reqSigners txouts mValue mLowBound upperBound fee certs wdrls metadataSchema scriptFiles metadataFiles mProtocolParamsFile mUpdateProposalFile [] [] outFile )