Skip to content

Commit a003d54

Browse files
committed
Update eraSpecificLedgerTxBody with Dijkstra era
1 parent 3583170 commit a003d54

File tree

1 file changed

+20
-18
lines changed
  • cardano-api/src/Cardano/Api/Experimental

1 file changed

+20
-18
lines changed

cardano-api/src/Cardano/Api/Experimental/Tx.hs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ import Cardano.Crypto.Hash qualified as Hash
167167
import Cardano.Ledger.Alonzo.TxBody qualified as L
168168
import Cardano.Ledger.Api qualified as L
169169
import Cardano.Ledger.Binary qualified as Ledger
170-
import Cardano.Ledger.Conway.TxBody qualified as L
171170
import Cardano.Ledger.Core qualified as Ledger
172171
import 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

317319
hashTxBody
318320
:: L.HashAnnotated (Ledger.TxBody era) L.EraIndependentTxBody

0 commit comments

Comments
 (0)