Skip to content

Commit 98d9021

Browse files
authored
Merge pull request #4993 from IntersectMBO/nm/3130-redundant-accessor-functions
Deprecate redundant accessor functions in Alonzo
2 parents a071029 + 627649c commit 98d9021

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

eras/alonzo/impl/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 1.14.0.0
44

5+
* Deprecate `inputs'`, `collateral'`, `outputs'`, `certs'`, `withdrawals'`, `txfee'`,
6+
`vldt'`, `update'`, `reqSignerHashes'`, `adHash'`, `mint'`, `scriptIntegrityHash'`,
7+
and `txnetworkid'`
58
* Move `Annotator` instances and `alonzoSegwitTx` to `testlib`
69
* Expose `addScriptsTxWitsRaw`, `decodeAlonzoPlutusScript` and `asHashedScriptPair`
710
* Expose `emptyAlonzoTxAuxDataRaw`, `decodeTxAuxDataByTokenType` and `addPlutusScripts`

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxBody/Internal.hs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,30 +500,43 @@ mint' :: AlonzoTxBody era -> MultiAsset
500500
scriptIntegrityHash' :: AlonzoTxBody era -> StrictMaybe ScriptIntegrityHash
501501
txnetworkid' :: AlonzoTxBody era -> StrictMaybe Network
502502
inputs' = atbrInputs . getMemoRawType
503+
{-# DEPRECATED inputs' "In favor of inputsTxBodyL" #-}
503504

504505
collateral' = atbrCollateral . getMemoRawType
506+
{-# DEPRECATED collateral' "In favor of collateralInputsTxBodyL" #-}
505507

506508
outputs' = atbrOutputs . getMemoRawType
509+
{-# DEPRECATED outputs' "In favor of outputsTxBodyL" #-}
507510

508511
certs' = atbrCerts . getMemoRawType
512+
{-# DEPRECATED certs' "In favor of certsTxBodyL" #-}
509513

510514
withdrawals' = atbrWithdrawals . getMemoRawType
515+
{-# DEPRECATED withdrawals' "In favor of withdrawalsTxBodyL" #-}
511516

512517
txfee' = atbrTxFee . getMemoRawType
518+
{-# DEPRECATED txfee' "In favor of feeTxBodyL" #-}
513519

514520
vldt' = atbrValidityInterval . getMemoRawType
521+
{-# DEPRECATED vldt' "In favor of vldtTxBodyL" #-}
515522

516523
update' = atbrUpdate . getMemoRawType
524+
{-# DEPRECATED update' "In favor of updateTxBodyL" #-}
517525

518526
reqSignerHashes' = atbrReqSignerHashes . getMemoRawType
527+
{-# DEPRECATED reqSignerHashes' "In favor of reqSignerHashesTxBodyL" #-}
519528

520529
adHash' = atbrAuxDataHash . getMemoRawType
530+
{-# DEPRECATED adHash' "In favor of auxDataHashTxBodyL" #-}
521531

522532
mint' = atbrMint . getMemoRawType
533+
{-# DEPRECATED mint' "In favor of mintTxBodyL" #-}
523534

524535
scriptIntegrityHash' = atbrScriptIntegrityHash . getMemoRawType
536+
{-# DEPRECATED scriptIntegrityHash' "In favor of scriptIntegrityHashTxBodyL" #-}
525537

526538
txnetworkid' = atbrTxNetworkId . getMemoRawType
539+
{-# DEPRECATED txnetworkid' "In favor of networkIdTxBodyL" #-}
527540

528541
instance
529542
(Era era, Eq (PParamsUpdate era), Eq (TxOut era), Eq (TxCert era)) =>

eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import Cardano.Ledger.Alonzo.TxAuxData (AlonzoTxAuxData (..), mkAlonzoTxAuxData)
4747
import Cardano.Ledger.Alonzo.TxBody (
4848
AlonzoTxBody (..),
4949
AlonzoTxOut (..),
50-
inputs',
5150
utxoEntrySize,
5251
)
5352
import Cardano.Ledger.Alonzo.TxWits (
@@ -429,7 +428,7 @@ instance EraGen AlonzoEra where
429428
(dataMapFromTxOut smallUtxo (TxDats (getDataMap scriptinfo mapScriptWit)))
430429
-- The data hashes come from two places
431430
(Redeemers rdmrMap)
432-
txinputs = inputs' txbody
431+
txinputs = txbody ^. inputsTxBodyL
433432
smallUtxo :: [TxOut AlonzoEra]
434433
smallUtxo = Map.elems (unUTxO (txInsFilter utxo txinputs))
435434
AlonzoScriptsNeeded purposeHashPairs = getScriptsNeeded @AlonzoEra utxo txbody

0 commit comments

Comments
 (0)