Skip to content

Commit e164ebf

Browse files
committed
Add TxAuxDataHash and deprecate AuxiliaryDayaHash in its favor.
1 parent a5c4074 commit e164ebf

File tree

45 files changed

+134
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+134
-166
lines changed

eras/allegra/impl/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.7.0.0
44

5+
* Remove deprecated `AuxiliaryData` type synonym
56
* Deprecate `Allegra` type synonym
67
* Remove crypto parametrization from `AllegraEra`
78

eras/allegra/impl/src/Cardano/Ledger/Allegra/TxAuxData.hs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ module Cardano.Ledger.Allegra.TxAuxData (
2323
metadataAllegraTxAuxDataL,
2424
AllegraEraTxAuxData (..),
2525
timelockScriptsAllegraTxAuxDataL,
26-
27-
-- * Deprecations
28-
AuxiliaryData,
2926
)
3027
where
3128

3229
import Cardano.Ledger.Allegra.Era (AllegraEra)
3330
import Cardano.Ledger.Allegra.Scripts (Timelock)
34-
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash (..))
3531
import Cardano.Ledger.Binary (
3632
Annotator (..),
3733
DecCBOR (..),
@@ -100,7 +96,7 @@ instance EraTxAuxData AllegraEra where
10096

10197
validateTxAuxData _ (AllegraTxAuxData md as) = as `deepseq` all validMetadatum md
10298

103-
hashTxAuxData aux = AuxiliaryDataHash (hashAnnotated aux)
99+
hashTxAuxData aux = TxAuxDataHash (hashAnnotated aux)
104100

105101
metadataAllegraTxAuxDataL :: Era era => Lens' (AllegraTxAuxData era) (Map Word64 Metadatum)
106102
metadataAllegraTxAuxDataL =
@@ -151,10 +147,6 @@ pattern AllegraTxAuxData blob sp <- (getMemoRawType -> AllegraTxAuxDataRaw blob
151147

152148
{-# COMPLETE AllegraTxAuxData #-}
153149

154-
type AuxiliaryData = AllegraTxAuxData
155-
156-
{-# DEPRECATED AuxiliaryData "Use `AllegraTxAuxData` instead" #-}
157-
158150
--------------------------------------------------------------------------------
159151
-- Serialisation
160152
--------------------------------------------------------------------------------

eras/allegra/impl/src/Cardano/Ledger/Allegra/TxBody/Internal.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import Cardano.Ledger.Allegra.Era (AllegraEra)
5252
import Cardano.Ledger.Allegra.Scripts (ValidityInterval (..))
5353
import Cardano.Ledger.Allegra.TxCert ()
5454
import Cardano.Ledger.Allegra.TxOut ()
55-
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash)
5655
import Cardano.Ledger.BaseTypes (SlotNo, StrictMaybe (SJust, SNothing))
5756
import Cardano.Ledger.Binary (Annotator, DecCBOR (..), EncCBOR (..), ToCBOR)
5857
import Cardano.Ledger.Binary.Coders (
@@ -106,7 +105,7 @@ data AllegraTxBodyRaw ma era = AllegraTxBodyRaw
106105
, atbrTxFee :: !Coin
107106
, atbrValidityInterval :: !ValidityInterval
108107
, atbrUpdate :: !(StrictMaybe (Update era))
109-
, atbrAuxDataHash :: !(StrictMaybe AuxiliaryDataHash)
108+
, atbrAuxDataHash :: !(StrictMaybe TxAuxDataHash)
110109
, atbrMint :: !ma
111110
}
112111

@@ -261,7 +260,7 @@ pattern AllegraTxBody ::
261260
Coin ->
262261
ValidityInterval ->
263262
StrictMaybe (Update era) ->
264-
StrictMaybe AuxiliaryDataHash ->
263+
StrictMaybe TxAuxDataHash ->
265264
AllegraTxBody era
266265
pattern AllegraTxBody
267266
{ atbInputs

eras/alonzo/impl/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.13.0.0
44

5+
* Stop re-exporting deprecated `AuxiliaryDataHash` from `Cardano.Ledger.Alonzo.TxAuxData`
56
* Deprecate `Alonzo` type synonym
67
* Remove crypto parametrization from `AlonzoEra`
78

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module Cardano.Ledger.Alonzo.TxAuxData (
3434
AlonzoEraTxAuxData (..),
3535
AlonzoTxAuxDataRaw,
3636
mkAlonzoTxAuxData,
37-
AuxiliaryDataHash (..),
3837
hashAlonzoTxAuxData,
3938
validateAlonzoTxAuxData,
4039
getAlonzoTxAuxDataScripts,
@@ -56,7 +55,6 @@ import Cardano.Ledger.Alonzo.Scripts (
5655
plutusScriptLanguage,
5756
validScript,
5857
)
59-
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash (..))
6058
import Cardano.Ledger.BaseTypes (ProtVer)
6159
import Cardano.Ledger.Binary (
6260
Annotator (..),
@@ -274,8 +272,8 @@ metadataAlonzoTxAuxDataL =
274272
hashAlonzoTxAuxData ::
275273
HashAnnotated x EraIndependentTxAuxData =>
276274
x ->
277-
AuxiliaryDataHash
278-
hashAlonzoTxAuxData x = AuxiliaryDataHash (hashAnnotated x)
275+
TxAuxDataHash
276+
hashAlonzoTxAuxData x = TxAuxDataHash (hashAnnotated x)
279277

280278
validateAlonzoTxAuxData ::
281279
(AlonzoEraScript era, Script era ~ AlonzoScript era) =>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import Cardano.Ledger.Alonzo.Scripts (
9898
AsIxItem (..),
9999
PlutusPurpose,
100100
)
101-
import Cardano.Ledger.Alonzo.TxAuxData (AuxiliaryDataHash (..))
101+
import Cardano.Ledger.Alonzo.TxAuxData ()
102102
import Cardano.Ledger.Alonzo.TxCert ()
103103
import Cardano.Ledger.Alonzo.TxOut
104104
import Cardano.Ledger.BaseTypes (
@@ -194,7 +194,7 @@ data AlonzoTxBodyRaw era = AlonzoTxBodyRaw
194194
, atbrReqSignerHashes :: Set (KeyHash 'Witness)
195195
, atbrMint :: !MultiAsset
196196
, atbrScriptIntegrityHash :: !(StrictMaybe ScriptIntegrityHash)
197-
, atbrAuxDataHash :: !(StrictMaybe AuxiliaryDataHash)
197+
, atbrAuxDataHash :: !(StrictMaybe TxAuxDataHash)
198198
, atbrTxNetworkId :: !(StrictMaybe Network)
199199
}
200200
deriving (Generic, Typeable)
@@ -409,7 +409,7 @@ pattern AlonzoTxBody ::
409409
Set (KeyHash 'Witness) ->
410410
MultiAsset ->
411411
StrictMaybe ScriptIntegrityHash ->
412-
StrictMaybe AuxiliaryDataHash ->
412+
StrictMaybe TxAuxDataHash ->
413413
StrictMaybe Network ->
414414
AlonzoTxBody era
415415
pattern AlonzoTxBody
@@ -498,7 +498,7 @@ withdrawals' :: AlonzoTxBody era -> Withdrawals
498498
vldt' :: AlonzoTxBody era -> ValidityInterval
499499
update' :: AlonzoTxBody era -> StrictMaybe (Update era)
500500
reqSignerHashes' :: AlonzoTxBody era -> Set (KeyHash 'Witness)
501-
adHash' :: AlonzoTxBody era -> StrictMaybe AuxiliaryDataHash
501+
adHash' :: AlonzoTxBody era -> StrictMaybe TxAuxDataHash
502502
mint' :: AlonzoTxBody era -> MultiAsset
503503
scriptIntegrityHash' :: AlonzoTxBody era -> StrictMaybe ScriptIntegrityHash
504504
txnetworkid' :: AlonzoTxBody era -> StrictMaybe Network

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
@@ -57,7 +57,6 @@ import Cardano.Ledger.Alonzo.TxWits (
5757
nullRedeemers,
5858
)
5959
import Cardano.Ledger.Alonzo.UTxO (AlonzoScriptsNeeded (..))
60-
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash)
6160
import Cardano.Ledger.BaseTypes
6261
import Cardano.Ledger.Binary (EncCBOR)
6362
import Cardano.Ledger.Coin (Coin (..))
@@ -263,7 +262,7 @@ genAlonzoTxBody ::
263262
Withdrawals ->
264263
Coin ->
265264
StrictMaybe (Update AlonzoEra) ->
266-
StrictMaybe AuxiliaryDataHash ->
265+
StrictMaybe TxAuxDataHash ->
267266
Gen (TxBody AlonzoEra, [Script AlonzoEra])
268267
genAlonzoTxBody _genenv utxo pparams currentslot input txOuts certs withdrawals fee updates auxDHash = do
269268
netid <- genM $ pure Testnet -- frequency [(2, pure Mainnet), (1, pure Testnet)]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Cardano.Ledger.Alonzo.Scripts (
1515
Prices (..),
1616
)
1717
import Cardano.Ledger.Alonzo.Tx (AlonzoTx (..), IsValid (..))
18-
import Cardano.Ledger.Alonzo.TxAuxData (AuxiliaryDataHash (..), mkAlonzoTxAuxData)
18+
import Cardano.Ledger.Alonzo.TxAuxData (mkAlonzoTxAuxData)
1919
import Cardano.Ledger.Alonzo.TxBody (AlonzoTxBody (..), AlonzoTxOut (..))
2020
import Cardano.Ledger.Alonzo.TxWits (AlonzoTxWits (..), Redeemers (..), TxDats (..))
2121
import Cardano.Ledger.BaseTypes (NonNegativeInterval, StrictMaybe (..), boundRational)
@@ -124,7 +124,7 @@ exampleTxBodyAlonzo =
124124
(Set.singleton $ SLE.mkKeyHash 212) -- reqSignerHashes
125125
exampleMultiAsset -- mint
126126
(SJust $ mkDummySafeHash 42) -- scriptIntegrityHash
127-
(SJust . AuxiliaryDataHash $ mkDummySafeHash 42) -- adHash
127+
(SJust . TxAuxDataHash $ mkDummySafeHash 42) -- adHash
128128
(SJust Mainnet) -- txnetworkid
129129
where
130130
MaryValue _ exampleMultiAsset = SLE.exampleMultiAssetValue 3

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import Cardano.Ledger.Alonzo (AlonzoEra)
1414
import Cardano.Ledger.Alonzo.Core
1515
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript (..))
1616
import Cardano.Ledger.Alonzo.Tx (AlonzoTxBody (..))
17-
import Cardano.Ledger.Alonzo.TxAuxData (AuxiliaryDataHash)
1817
import Cardano.Ledger.Alonzo.TxBody (AlonzoTxOut (..))
1918
import Cardano.Ledger.BaseTypes
2019
import Cardano.Ledger.Binary (EncCBOR (..))
@@ -46,7 +45,7 @@ instance Era era => Twiddle (ShelleyTxCert era) where
4645
instance Twiddle Withdrawals where
4746
twiddle v = twiddle v . toTerm v
4847

49-
instance Twiddle AuxiliaryDataHash where
48+
instance Twiddle TxAuxDataHash where
5049
twiddle v = twiddle v . toTerm v
5150

5251
instance Twiddle (Update AlonzoEra) where

eras/babbage/impl/src/Cardano/Ledger/Babbage/TxBody/Internal.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ module Cardano.Ledger.Babbage.TxBody.Internal (
9090
import Cardano.Ledger.Alonzo (AlonzoEra)
9191
import Cardano.Ledger.Alonzo.Core
9292
import Cardano.Ledger.Alonzo.PParams (AlonzoPParams (appExtraEntropy), appD)
93-
import Cardano.Ledger.Alonzo.TxAuxData (AuxiliaryDataHash (..))
9493
import Cardano.Ledger.Alonzo.TxBody (alonzoRedeemerPointer, alonzoRedeemerPointerInverse)
9594
import Cardano.Ledger.Babbage.Era (BabbageEra)
9695
import Cardano.Ledger.Babbage.PParams (upgradeBabbagePParams)
@@ -177,7 +176,7 @@ data BabbageTxBodyRaw era = BabbageTxBodyRaw
177176
-- Operations on the TxBody in the BabbageEra depend upon this.
178177
-- We now store only the MultiAsset part of a Mary.Value.
179178
btbrScriptIntegrityHash :: !(StrictMaybe ScriptIntegrityHash)
180-
, btbrAuxDataHash :: !(StrictMaybe AuxiliaryDataHash)
179+
, btbrAuxDataHash :: !(StrictMaybe TxAuxDataHash)
181180
, btbrTxNetworkId :: !(StrictMaybe Network)
182181
}
183182
deriving (Generic, Typeable)
@@ -263,7 +262,7 @@ feeBabbageTxBodyL =
263262
{-# INLINEABLE feeBabbageTxBodyL #-}
264263

265264
auxDataHashBabbageTxBodyL ::
266-
BabbageEraTxBody era => Lens' (BabbageTxBody era) (StrictMaybe AuxiliaryDataHash)
265+
BabbageEraTxBody era => Lens' (BabbageTxBody era) (StrictMaybe TxAuxDataHash)
267266
auxDataHashBabbageTxBodyL =
268267
lensMemoRawType btbrAuxDataHash $
269268
\txBodyRaw auxDataHash -> txBodyRaw {btbrAuxDataHash = auxDataHash}
@@ -601,7 +600,7 @@ pattern BabbageTxBody ::
601600
Set (KeyHash 'Witness) ->
602601
MultiAsset ->
603602
StrictMaybe ScriptIntegrityHash ->
604-
StrictMaybe AuxiliaryDataHash ->
603+
StrictMaybe TxAuxDataHash ->
605604
StrictMaybe Network ->
606605
BabbageTxBody era
607606
pattern BabbageTxBody
@@ -703,7 +702,7 @@ withdrawals' :: BabbageTxBody era -> Withdrawals
703702
vldt' :: BabbageTxBody era -> ValidityInterval
704703
update' :: BabbageTxBody era -> StrictMaybe (Update era)
705704
reqSignerHashes' :: BabbageTxBody era -> Set (KeyHash 'Witness)
706-
adHash' :: BabbageTxBody era -> StrictMaybe AuxiliaryDataHash
705+
adHash' :: BabbageTxBody era -> StrictMaybe TxAuxDataHash
707706
mint' :: BabbageTxBody era -> MultiAsset
708707
scriptIntegrityHash' :: BabbageTxBody era -> StrictMaybe ScriptIntegrityHash
709708
spendInputs' = btbrSpendInputs . getMemoRawType

0 commit comments

Comments
 (0)