@@ -26,7 +26,7 @@ module Cardano.Ledger.Alonzo.TxAuxData (
2626 AlonzoTxAuxData ,
2727 AlonzoTxAuxData' ,
2828 atadMetadata ,
29- atadNative ,
29+ atadNativeScripts ,
3030 atadPlutus ,
3131 atadMetadata' ,
3232 atadNative' ,
@@ -122,7 +122,7 @@ deriving via
122122instance Era era => EncCBOR (AlonzoTxAuxData era )
123123
124124instance (Era era , EncCBOR (NativeScript era )) => EncCBOR (AlonzoTxAuxDataRaw era ) where
125- encCBOR AlonzoTxAuxDataRaw {atadrMetadata, atadrNative , atadrPlutus} =
125+ encCBOR AlonzoTxAuxDataRaw {atadrMetadata, atadrNativeScripts , atadrPlutus} =
126126 encode $
127127 Tag 259 $
128128 Keyed
@@ -139,7 +139,7 @@ instance (Era era, EncCBOR (NativeScript era)) => EncCBOR (AlonzoTxAuxDataRaw er
139139 ]
140140 )
141141 !> Omit null (Key 0 $ To atadrMetadata)
142- !> Omit null (Key 1 $ To atadrNative )
142+ !> Omit null (Key 1 $ To atadrNativeScripts )
143143 !> Omit isNothing (Key 2 $ E (maybe mempty encCBOR) (Map. lookup PlutusV1 atadrPlutus))
144144 !> Omit isNothing (Key 3 $ E (maybe mempty encCBOR) (Map. lookup PlutusV2 atadrPlutus))
145145 !> Omit isNothing (Key 4 $ E (maybe mempty encCBOR) (Map. lookup PlutusV3 atadrPlutus))
@@ -156,7 +156,7 @@ mkAlonzoTxAuxData ::
156156 AlonzoTxAuxData era
157157mkAlonzoTxAuxData atadrMetadata allScripts =
158158 mkMemoizedEra @ era $
159- AlonzoTxAuxDataRaw {atadrMetadata, atadrNative , atadrPlutus}
159+ AlonzoTxAuxDataRaw {atadrMetadata, atadrNativeScripts , atadrPlutus}
160160 where
161161 partitionScripts (tss, pss) =
162162 \ case
@@ -165,15 +165,15 @@ mkAlonzoTxAuxData atadrMetadata allScripts =
165165 let lang = plutusScriptLanguage ps
166166 bs = plutusScriptBinary ps
167167 in (tss, Map. alter (Just . maybe (pure bs) (NE. cons bs)) lang pss)
168- (atadrNative , atadrPlutus) =
168+ (atadrNativeScripts , atadrPlutus) =
169169 foldr (flip partitionScripts) (mempty , Map. empty) allScripts
170170
171171getAlonzoTxAuxDataScripts ::
172172 forall era .
173173 AlonzoEraScript era =>
174174 AlonzoTxAuxData era ->
175175 StrictSeq (AlonzoScript era )
176- getAlonzoTxAuxDataScripts AlonzoTxAuxData {atadNative = timelocks, atadPlutus = plutus} =
176+ getAlonzoTxAuxDataScripts AlonzoTxAuxData {atadNativeScripts = timelocks, atadPlutus = plutus} =
177177 mconcat $
178178 (NativeScript <$> timelocks)
179179 : [ StrictSeq. fromList $
@@ -223,7 +223,7 @@ instance
223223 auxDataField 0 = fieldA (\ x ad -> ad {atadrMetadata = x}) From
224224 auxDataField 1 =
225225 fieldAA
226- (\ x ad -> ad {atadrNative = atadrNative ad <> x})
226+ (\ x ad -> ad {atadrNativeScripts = atadrNativeScripts ad <> x})
227227 (D (sequence <$> decodeStrictSeq decCBOR))
228228 auxDataField 2 = fieldA (addPlutusScripts PlutusV1 ) (D (guardPlutus PlutusV1 >> decCBOR))
229229 auxDataField 3 = fieldA (addPlutusScripts PlutusV2 ) (D (guardPlutus PlutusV2 >> decCBOR))
@@ -312,8 +312,8 @@ nativeScriptsAlonzoTxAuxDataL ::
312312 forall era .
313313 (Era era , EncCBOR (NativeScript era )) => Lens' (AlonzoTxAuxData era ) (StrictSeq (NativeScript era ))
314314nativeScriptsAlonzoTxAuxDataL =
315- lensMemoRawType @ era atadrNative $
316- \ txAuxDataRaw ts -> txAuxDataRaw {atadrNative = ts}
315+ lensMemoRawType @ era atadrNativeScripts $
316+ \ txAuxDataRaw ts -> txAuxDataRaw {atadrNativeScripts = ts}
317317
318318instance AlonzoEraTxAuxData AlonzoEra where
319319 plutusScriptsTxAuxDataL = plutusScriptsAllegraTxAuxDataL
@@ -352,18 +352,18 @@ pattern AlonzoTxAuxData ::
352352 StrictSeq (NativeScript era) ->
353353 Map Language (NE. NonEmpty PlutusBinary ) ->
354354 AlonzoTxAuxData era
355- pattern AlonzoTxAuxData {atadMetadata, atadNative , atadPlutus} <-
356- (getMemoRawType -> AlonzoTxAuxDataRaw atadMetadata atadNative atadPlutus)
355+ pattern AlonzoTxAuxData {atadMetadata, atadNativeScripts , atadPlutus} <-
356+ (getMemoRawType -> AlonzoTxAuxDataRaw atadMetadata atadNativeScripts atadPlutus)
357357 where
358- AlonzoTxAuxData atadrMetadata atadrNative atadrPlutus =
358+ AlonzoTxAuxData atadrMetadata atadrNativeScripts atadrPlutus =
359359 let unsupportedScripts =
360360 Map. filterWithKey (\ lang _ -> lang > eraMaxLanguage @ era ) atadrPlutus
361361 prefix =
362362 intercalate " ," (show <$> Map. keys unsupportedScripts)
363363 ++ if Map. size unsupportedScripts > 1 then " languages are" else " language is"
364364 in if Map. null unsupportedScripts
365365 then
366- mkMemoizedEra @ era $ AlonzoTxAuxDataRaw {atadrMetadata, atadrNative , atadrPlutus}
366+ mkMemoizedEra @ era $ AlonzoTxAuxDataRaw {atadrMetadata, atadrNativeScripts , atadrPlutus}
367367 else error $ prefix ++ " not supported in " ++ eraName @ era
368368
369369{-# COMPLETE AlonzoTxAuxData #-}
0 commit comments