@@ -157,7 +157,8 @@ runTransactionBuildCmd
157157 , mUpdateProposalFile
158158 , voteFiles
159159 , proposalFiles
160- , treasuryDonation -- Maybe TxTreasuryDonation
160+ , includeCurrentTreasuryValue
161+ , mTreasuryDonation
161162 , isCborOutCanonical
162163 , buildOutputOptions
163164 } = do
@@ -288,14 +289,9 @@ runTransactionBuildCmd
288289 )
289290 & fromEitherCIOCli
290291
291- let currentTreasuryValueAndDonation =
292- case (treasuryDonation, unFeatured <$> featuredCurrentTreasuryValueM) of
293- (Nothing , _) -> Nothing -- We shouldn't specify the treasury value when no donation is being done
294- (Just td, mctv) -> Just (mctv, td) -- Current treasury value is not mandatory for donations, see:
295- -- \* https://intersectmbo.github.io/formal-ledger-specifications/site/Ledger.Conway.Specification.Utxo.html#sec:the-utxo-transition-system
296- -- \* https://intersectmbo.github.io/formal-ledger-specifications/site/Notation.html#the-maybe-type
297- -- And discussion:
298- -- \* https://discord.com/channels/1136727663583698984/1239888777015590913/1364244737602879498
292+ let mCurrenTreasuryValue = case includeCurrentTreasuryValue of
293+ IncludeCurrentTreasuryValue -> unFeatured <$> featuredCurrentTreasuryValueM
294+ ExcludeCurrentTreasuryValue -> Nothing
299295
300296 -- We need to construct the txBodycontent outside of runTxBuild
301297 BalancedTxBody txBodyContent balancedTxBody _ _ <-
@@ -323,7 +319,8 @@ runTransactionBuildCmd
323319 mOverrideWitnesses
324320 votingProceduresAndMaybeScriptWits
325321 proposals
326- currentTreasuryValueAndDonation
322+ mCurrenTreasuryValue
323+ mTreasuryDonation
327324
328325 -- TODO: Calculating the script cost should live as a different command.
329326 -- Why? Because then we can simply read a txbody and figure out
@@ -410,7 +407,8 @@ runTransactionBuildEstimateCmd -- TODO change type
410407 , proposalFiles
411408 , plutusCollateral
412409 , totalReferenceScriptSize
413- , currentTreasuryValueAndDonation
410+ , currentTreasuryValue
411+ , treasuryDonation
414412 , isCborOutCanonical
415413 , txBodyOutFile
416414 } = do
@@ -497,7 +495,8 @@ runTransactionBuildEstimateCmd -- TODO change type
497495 TxUpdateProposalNone
498496 votingProceduresAndMaybeScriptWits
499497 proposals
500- currentTreasuryValueAndDonation
498+ currentTreasuryValue
499+ treasuryDonation
501500 let stakeCredentialsToDeregisterMap = fromList $ catMaybes [getStakeDeregistrationInfo cert | (cert, _) <- certsAndMaybeScriptWits]
502501 drepsToDeregisterMap =
503502 fromList $
@@ -615,7 +614,8 @@ runTransactionBuildRawCmd
615614 , mUpdateProprosalFile
616615 , voteFiles
617616 , proposalFiles
618- , currentTreasuryValueAndDonation
617+ , mCurrentTreasuryValue
618+ , mTreasuryDonation
619619 , isCborOutCanonical
620620 , txBodyOutFile
621621 } = Exp. obtainCommonConstraints eon $ do
@@ -701,7 +701,8 @@ runTransactionBuildRawCmd
701701 txUpdateProposal
702702 votingProceduresAndMaybeScriptWits
703703 proposals
704- currentTreasuryValueAndDonation
704+ mCurrentTreasuryValue
705+ mTreasuryDonation
705706
706707 let Exp. SignedTx tx = Exp. signTx eon [] [] txBody
707708 -- TODO: Create equivalent write text envelope functions for
@@ -746,7 +747,8 @@ runTxBuildRaw
746747 -> TxUpdateProposal era
747748 -> [(VotingProcedures era , Maybe (VoteScriptWitness era ))]
748749 -> [(Proposal era , Maybe (ProposalScriptWitness era ))]
749- -> Maybe (Maybe TxCurrentTreasuryValue , TxTreasuryDonation )
750+ -> Maybe TxCurrentTreasuryValue
751+ -> Maybe TxTreasuryDonation
750752 -> Either TxCmdError (Exp. UnsignedTx era )
751753runTxBuildRaw
752754 mScriptValidity
@@ -769,7 +771,8 @@ runTxBuildRaw
769771 txUpdateProposal
770772 votingProcedures
771773 proposals
772- mCurrentTreasuryValueAndDonation = do
774+ mCurrentTreasuryValue
775+ mTreasuryDonation = do
773776 txBodyContent <-
774777 constructTxBodyContent
775778 mScriptValidity
@@ -792,7 +795,8 @@ runTxBuildRaw
792795 txUpdateProposal
793796 votingProcedures
794797 proposals
795- mCurrentTreasuryValueAndDonation
798+ mCurrentTreasuryValue
799+ mTreasuryDonation
796800
797801 first TxCmdTxBodyError $ Exp. makeUnsignedTx Exp. useEra txBodyContent
798802
@@ -832,7 +836,8 @@ constructTxBodyContent
832836 -> TxUpdateProposal era
833837 -> [(VotingProcedures era , Maybe (VoteScriptWitness era ))]
834838 -> [(Proposal era , Maybe (ProposalScriptWitness era ))]
835- -> Maybe (Maybe TxCurrentTreasuryValue , TxTreasuryDonation )
839+ -> Maybe TxCurrentTreasuryValue
840+ -> Maybe TxTreasuryDonation
836841 -- ^ The current treasury value and the donation. This is a stop gap as the
837842 -- semantics of the donation and treasury value depend on the script languages
838843 -- being used.
@@ -858,7 +863,8 @@ constructTxBodyContent
858863 txUpdateProposal
859864 votingProcedures
860865 proposals
861- mCurrentTreasuryValueAndDonation =
866+ mCurrentTreasuryValue
867+ mTreasuryDonation =
862868 do
863869 let sbe = convert $ Exp. useEra @ era
864870 let allReferenceInputs =
@@ -894,8 +900,8 @@ constructTxBodyContent
894900 [(prop, pswScriptWitness <$> mSwit) | (Proposal prop, mSwit) <- proposals]
895901 Featured w txp
896902
897- let validatedCurrentTreasuryValue = validateTxCurrentTreasuryValue @ era ( fst =<< mCurrentTreasuryValueAndDonation)
898- validatedTreasuryDonation = validateTxTreasuryDonation @ era ( snd <$> mCurrentTreasuryValueAndDonation)
903+ let validatedCurrentTreasuryValue = validateTxCurrentTreasuryValue @ era mCurrentTreasuryValue
904+ validatedTreasuryDonation = validateTxTreasuryDonation @ era mTreasuryDonation
899905 return $
900906 shelleyBasedEraConstraints
901907 sbe
@@ -972,7 +978,8 @@ runTxBuild
972978 -> Maybe Word
973979 -> [(VotingProcedures era , Maybe (VoteScriptWitness era ))]
974980 -> [(Proposal era , Maybe (ProposalScriptWitness era ))]
975- -> Maybe (Maybe TxCurrentTreasuryValue , TxTreasuryDonation )
981+ -> Maybe TxCurrentTreasuryValue
982+ -> Maybe TxTreasuryDonation
976983 -- ^ The current treasury value and the donation.
977984 -> ExceptT TxCmdError IO (BalancedTxBody era )
978985runTxBuild
@@ -998,7 +1005,8 @@ runTxBuild
9981005 mOverrideWits
9991006 votingProcedures
10001007 proposals
1001- mCurrentTreasuryValueAndDonation = do
1008+ mCurrentTreasuryValue
1009+ mTreasuryDonation = do
10021010 let sbe = convert (Exp. useEra @ era )
10031011 shelleyBasedEraConstraints sbe $ do
10041012 -- TODO: All functions should be parameterized by ShelleyBasedEra
@@ -1065,7 +1073,8 @@ runTxBuild
10651073 txUpdateProposal
10661074 votingProcedures
10671075 proposals
1068- mCurrentTreasuryValueAndDonation
1076+ mCurrentTreasuryValue
1077+ mTreasuryDonation
10691078
10701079 firstExceptT TxCmdTxInsDoNotExist
10711080 . hoistEither
0 commit comments