Skip to content

Commit

Permalink
Remove unused transitional util makeShelleyTransaction
Browse files Browse the repository at this point in the history
This was a transitional helper function (from when we made the tx body
representation era-generic). It makes much less sense now that scripts
are placed within the tx body. Fortunately it is no longer used so we
can just remove it.

The equivalent makeByronTransaction transitional util still exists, but
since we do not use scripts in Byron transactions it is not problematic.
Nevertheless, mark it as deprecated so we stop using it in the CLI and
other clients.
  • Loading branch information
dcoutts authored and Jimbo4350 committed Apr 8, 2021
1 parent ee9be65 commit dd45445
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions cardano-api/src/Cardano/Api/TxBody.hs
Expand Up @@ -25,7 +25,6 @@ module Cardano.Api.TxBody (

-- ** Transitional utils
makeByronTransaction,
makeShelleyTransaction,

-- * Transaction Ids
TxId(..),
Expand Down Expand Up @@ -1408,47 +1407,7 @@ makeByronTransaction txIns txOuts =
txUpdateProposal = TxUpdateProposalNone,
txMintValue = TxMintNone
}

-- | Transitional function to help the CLI move to the updated TxBody API.
--
makeShelleyTransaction :: [TxIn]
-> [TxOut ShelleyEra]
-> SlotNo
-> Lovelace
-> [Certificate]
-> [(StakeAddress, Lovelace)]
-> Maybe TxMetadata
-> Maybe UpdateProposal
-> Either (TxBodyError ShelleyEra) (TxBody ShelleyEra)
makeShelleyTransaction txIns txOuts ttl fee
certs withdrawals mMetadata mUpdateProp =
makeTransactionBody $
TxBodyContent {
txIns = [ (txin, BuildTxWith (KeyWitness KeyWitnessForSpending))
| txin <- txIns ],
txOuts,
txFee = TxFeeExplicit TxFeesExplicitInShelleyEra fee,
txValidityRange = (TxValidityNoLowerBound,
TxValidityUpperBound
ValidityUpperBoundInShelleyEra ttl),
txMetadata = case mMetadata of
Nothing -> TxMetadataNone
Just md -> TxMetadataInEra
TxMetadataInShelleyEra md,
txAuxScripts = TxAuxScriptsNone,
txWithdrawals = TxWithdrawals WithdrawalsInShelleyEra
[ (stakeaddr, lovelace,
BuildTxWith (KeyWitness KeyWitnessForStakeAddr))
| (stakeaddr, lovelace) <- withdrawals ],
txCertificates = TxCertificates CertificatesInShelleyEra certs
(BuildTxWith Map.empty),
txUpdateProposal = case mUpdateProp of
Nothing -> TxUpdateProposalNone
Just up -> TxUpdateProposal
UpdateProposalInShelleyEra up,
txMintValue = TxMintNone
}

{-# DEPRECATED makeByronTransaction "Use makeTransactionBody" #-}

-- ----------------------------------------------------------------------------
-- Other utilities helpful with making transaction bodies
Expand Down

0 comments on commit dd45445

Please sign in to comment.