@@ -167,7 +167,6 @@ import Cardano.Crypto.Hash qualified as Hash
167167import Cardano.Ledger.Alonzo.TxBody qualified as L
168168import Cardano.Ledger.Api qualified as L
169169import Cardano.Ledger.Binary qualified as Ledger
170- import Cardano.Ledger.Conway.TxBody qualified as L
171170import Cardano.Ledger.Core qualified as Ledger
172171import Cardano.Ledger.Hashes qualified as L hiding (Hash )
173172
@@ -285,7 +284,7 @@ makeUnsignedTx era bc = obtainCommonConstraints era $ do
285284 & L. datsTxWitsL .~ datums
286285 & L. rdmrsTxWitsL .~ redeemers
287286
288- eraSpecificTxBody <- eraSpecificLedgerTxBody era ledgerTxBody bc
287+ let eraSpecificTxBody = eraSpecificLedgerTxBody era ledgerTxBody bc
289288
290289 return . UnsignedTx $
291290 L. mkBasicTx eraSpecificTxBody
@@ -297,22 +296,25 @@ eraSpecificLedgerTxBody
297296 :: Era era
298297 -> Ledger. TxBody (LedgerEra era )
299298 -> TxBodyContent BuildTx era
300- -> Either TxBodyError (Ledger. TxBody (LedgerEra era ))
301- eraSpecificLedgerTxBody ConwayEra ledgerbody bc =
302- let propProcedures = txProposalProcedures bc
303- voteProcedures = txVotingProcedures bc
304- treasuryDonation = txTreasuryDonation bc
305- currentTresuryValue = txCurrentTreasuryValue bc
306- in return $
307- ledgerbody
308- & L. proposalProceduresTxBodyL
309- .~ convProposalProcedures (maybe TxProposalProceduresNone unFeatured propProcedures)
310- & L. votingProceduresTxBodyL
311- .~ convVotingProcedures (maybe TxVotingProceduresNone unFeatured voteProcedures)
312- & L. treasuryDonationTxBodyL
313- .~ maybe (L. Coin 0 ) unFeatured treasuryDonation
314- & L. currentTreasuryValueTxBodyL
315- .~ L. maybeToStrictMaybe (unFeatured =<< currentTresuryValue)
299+ -> Ledger. TxBody (LedgerEra era )
300+ eraSpecificLedgerTxBody era ledgerbody bc =
301+ body era
302+ where
303+ body e =
304+ let propProcedures = txProposalProcedures bc
305+ voteProcedures = txVotingProcedures bc
306+ treasuryDonation = txTreasuryDonation bc
307+ currentTresuryValue = txCurrentTreasuryValue bc
308+ in obtainCommonConstraints e $
309+ ledgerbody
310+ & L. proposalProceduresTxBodyL
311+ .~ convProposalProcedures (maybe TxProposalProceduresNone unFeatured propProcedures)
312+ & L. votingProceduresTxBodyL
313+ .~ convVotingProcedures (maybe TxVotingProceduresNone unFeatured voteProcedures)
314+ & L. treasuryDonationTxBodyL
315+ .~ maybe (L. Coin 0 ) unFeatured treasuryDonation
316+ & L. currentTreasuryValueTxBodyL
317+ .~ L. maybeToStrictMaybe (unFeatured =<< currentTresuryValue)
316318
317319hashTxBody
318320 :: L. HashAnnotated (Ledger. TxBody era ) L. EraIndependentTxBody
0 commit comments