Skip to content

Commit

Permalink
Remove constraints from mkCommonTxBody
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 9, 2023
1 parent 7100692 commit 11efd28
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions cardano-api/internal/Cardano/Api/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,13 +1860,11 @@ createTransactionBody sbe txBodyContent =
languages = convLanguages apiScriptWitnesses

mkTxBody :: ()
=> L.EraTxBody (ShelleyLedgerEra era)
=> L.EraTxAuxData (ShelleyLedgerEra era)
=> ShelleyBasedEra era
-> TxBodyContent BuildTx era
-> Maybe (L.TxAuxData (ShelleyLedgerEra era))
-> L.TxBody (ShelleyLedgerEra era)
mkTxBody sbe' bc = shelleyBasedEraConstraints sbe' $
mkTxBody sbe' bc =
mkCommonTxBody
sbe'
(txIns bc)
Expand Down Expand Up @@ -2824,11 +2822,7 @@ guardShelleyTxInsOverflow txIns = do

-- | A helper function that constructs a TxBody with all of the fields that are common for
-- all eras
mkCommonTxBody ::
( L.EraTxBody (ShelleyLedgerEra era)
, L.EraTxAuxData (ShelleyLedgerEra era)
, L.EraCrypto (ShelleyLedgerEra era) ~ StandardCrypto
)
mkCommonTxBody :: ()
=> ShelleyBasedEra era
-> TxIns BuildTx era
-> [TxOut ctx era]
Expand All @@ -2837,12 +2831,13 @@ mkCommonTxBody ::
-> Maybe (L.TxAuxData (ShelleyLedgerEra era))
-> L.TxBody (ShelleyLedgerEra era)
mkCommonTxBody sbe txIns txOuts txFee txWithdrawals txAuxData =
L.mkBasicTxBody
& L.inputsTxBodyL .~ convTxIns txIns
& L.outputsTxBodyL .~ convTxOuts sbe txOuts
& L.feeTxBodyL .~ convTransactionFee sbe txFee
& L.withdrawalsTxBodyL .~ convWithdrawals txWithdrawals
& L.auxDataHashTxBodyL .~ maybe SNothing (SJust . Ledger.hashTxAuxData) txAuxData
shelleyBasedEraConstraints sbe $
L.mkBasicTxBody
& L.inputsTxBodyL .~ convTxIns txIns
& L.outputsTxBodyL .~ convTxOuts sbe txOuts
& L.feeTxBodyL .~ convTransactionFee sbe txFee
& L.withdrawalsTxBodyL .~ convWithdrawals txWithdrawals
& L.auxDataHashTxBodyL .~ maybe SNothing (SJust . Ledger.hashTxAuxData) txAuxData


makeShelleyTransactionBody :: forall era. ()
Expand Down

0 comments on commit 11efd28

Please sign in to comment.