diff --git a/eras/alonzo/impl/CHANGELOG.md b/eras/alonzo/impl/CHANGELOG.md index d62a98df84e..842b3f04b1d 100644 --- a/eras/alonzo/impl/CHANGELOG.md +++ b/eras/alonzo/impl/CHANGELOG.md @@ -5,7 +5,8 @@ * Change the type of the balance field in `InsufficientCollateral` to `DeltaCoin` * Add `ToJSON` instances for `FailureDescription` and `TagMismatchDescription` * Undeprecate `redeemerPointer`. -* Add `metadataAlonzoTxAuxDataL`, `timelockScriptsAlonzoTxAuxDataL`. +* Add `AlonzoEraTxAuxData` with `plutusScriptsTxAuxDataL` +* Add `metadataAlonzoTxAuxDataL`, `timelockScriptsAlonzoTxAuxDataL` and `plutusScriptsAllegraTxAuxDataL` ## 1.7.0.0 diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs index 295014dc10b..646067f8727 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs @@ -32,6 +32,7 @@ module Cardano.Ledger.Alonzo.Core ( ppuMaxValSizeL, ppuCollateralPercentageL, ppuMaxCollateralInputsL, + AlonzoEraTxAuxData (..), module Cardano.Ledger.Mary.Core, ) where @@ -67,6 +68,7 @@ import Cardano.Ledger.Alonzo.Scripts ( pattern SpendingPurpose, ) import Cardano.Ledger.Alonzo.Tx (AlonzoEraTx (..)) +import Cardano.Ledger.Alonzo.TxAuxData (AlonzoEraTxAuxData (..)) import Cardano.Ledger.Alonzo.TxBody (AlonzoEraTxBody (..), ScriptIntegrityHash) import Cardano.Ledger.Alonzo.TxOut (AlonzoEraTxOut (..)) import Cardano.Ledger.Alonzo.TxWits (AlonzoEraTxWits (..)) diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs index c1c73d70b91..5a514e6a67c 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs @@ -30,6 +30,7 @@ module Cardano.Ledger.Alonzo.TxAuxData ( atadTimelock', atadPlutus' ), + AlonzoEraTxAuxData (..), AlonzoTxAuxDataRaw, mkAlonzoTxAuxData, AuxiliaryDataHash (..), @@ -39,6 +40,7 @@ module Cardano.Ledger.Alonzo.TxAuxData ( translateAlonzoTxAuxData, metadataAlonzoTxAuxDataL, timelockScriptsAlonzoTxAuxDataL, + plutusScriptsAllegraTxAuxDataL, -- * Deprecated AuxiliaryData, @@ -99,8 +101,8 @@ import GHC.Stack import Lens.Micro (Lens') import NoThunks.Class (InspectHeapNamed (..), NoThunks) --- ============================================================================= --- Version without serialized bytes +class AllegraEraTxAuxData era => AlonzoEraTxAuxData era where + plutusScriptsTxAuxDataL :: Lens' (TxAuxData era) (Map Language (NE.NonEmpty PlutusBinary)) data AlonzoTxAuxDataRaw era = AlonzoTxAuxDataRaw { atadrMetadata :: !(Map Word64 Metadatum) @@ -301,6 +303,14 @@ timelockScriptsAlonzoTxAuxDataL :: timelockScriptsAlonzoTxAuxDataL = lensMemoRawType atadrTimelock $ \txAuxDataRaw ts -> txAuxDataRaw {atadrTimelock = ts} +instance Crypto c => AlonzoEraTxAuxData (AlonzoEra c) where + plutusScriptsTxAuxDataL = plutusScriptsAllegraTxAuxDataL + +plutusScriptsAllegraTxAuxDataL :: + Era era => Lens' (AlonzoTxAuxData era) (Map Language (NE.NonEmpty PlutusBinary)) +plutusScriptsAllegraTxAuxDataL = + lensMemoRawType atadrPlutus $ \txAuxDataRaw ts -> txAuxDataRaw {atadrPlutus = ts} + instance EraCrypto era ~ c => HashAnnotated (AuxiliaryData era) EraIndependentTxAuxData c where hashAnnotated = getMemoSafeHash diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxAuxData.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxAuxData.hs index 873c27c74d1..29ed6faffc5 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxAuxData.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxAuxData.hs @@ -8,6 +8,7 @@ import Cardano.Ledger.Alonzo.TxAuxData ( AlonzoTxAuxData (..), hashAlonzoTxAuxData, metadataAlonzoTxAuxDataL, + plutusScriptsAllegraTxAuxDataL, timelockScriptsAlonzoTxAuxDataL, translateAlonzoTxAuxData, validateAlonzoTxAuxData, @@ -31,3 +32,6 @@ instance Crypto c => EraTxAuxData (BabbageEra c) where instance Crypto c => AllegraEraTxAuxData (BabbageEra c) where timelockScriptsTxAuxDataL = timelockScriptsAlonzoTxAuxDataL + +instance Crypto c => AlonzoEraTxAuxData (BabbageEra c) where + plutusScriptsTxAuxDataL = plutusScriptsAllegraTxAuxDataL diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxAuxData.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxAuxData.hs index 8b0e7c5374c..f0f176f9d4e 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxAuxData.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxAuxData.hs @@ -8,6 +8,7 @@ import Cardano.Ledger.Alonzo.TxAuxData ( AlonzoTxAuxData (..), hashAlonzoTxAuxData, metadataAlonzoTxAuxDataL, + plutusScriptsAllegraTxAuxDataL, timelockScriptsAlonzoTxAuxDataL, translateAlonzoTxAuxData, validateAlonzoTxAuxData, @@ -31,3 +32,6 @@ instance Crypto c => EraTxAuxData (ConwayEra c) where instance Crypto c => AllegraEraTxAuxData (ConwayEra c) where timelockScriptsTxAuxDataL = timelockScriptsAlonzoTxAuxDataL + +instance Crypto c => AlonzoEraTxAuxData (ConwayEra c) where + plutusScriptsTxAuxDataL = plutusScriptsAllegraTxAuxDataL diff --git a/libs/cardano-ledger-api/CHANGELOG.md b/libs/cardano-ledger-api/CHANGELOG.md index 7afa46d3056..f788d40fc63 100644 --- a/libs/cardano-ledger-api/CHANGELOG.md +++ b/libs/cardano-ledger-api/CHANGELOG.md @@ -5,6 +5,7 @@ * Add `redeemerPointer` and `redeemerPointerInverse`. * Export `mkBasicTxAuxData` and `metadataTxAuxDataL`. * Export `AllegraEraTxAuxData` and `timelockScriptsTxAuxDataL` +* Export `AlonzoEraTxAuxData` and `plutusScriptsTxAuxDataL` ## 1.9.0.0 @@ -22,7 +23,8 @@ * Deprecate `deserialiseRewardAcnt` in favor of `deserialiseRewardAccount` * Deprecate `serialiseRewardAcnt` in favor of `serialiseRewardAccount` * Deprecate `RewardAcnt` in favor of `RewardAccount` -* Remove `registerInitialFunds`, `registerInitialStaking`, `registerInitialDReps`, and `registerDelegs` in favor of `injectIntoTestState`. +* Remove `registerInitialFunds`, `registerInitialStaking`, `registerInitialDReps`, and + `registerDelegs` in favor of `injectIntoTestState`. * Change the semantics of `createInitialState` to not register any initial funds or delegates. ## 1.8.0.0 diff --git a/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Tx/AuxData.hs b/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Tx/AuxData.hs index 34121799d82..e0ac8b73194 100644 --- a/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Tx/AuxData.hs +++ b/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Tx/AuxData.hs @@ -16,6 +16,8 @@ module Cardano.Ledger.Api.Tx.AuxData ( AllegraTxAuxData (..), -- * Alonzo + AlonzoEraTxAuxData, + plutusScriptsTxAuxDataL, AlonzoTxAuxData (..), mkAlonzoTxAuxData, getAlonzoTxAuxDataScripts, @@ -24,6 +26,7 @@ where import Cardano.Ledger.Allegra.TxAuxData (AllegraEraTxAuxData (..), AllegraTxAuxData (..)) import Cardano.Ledger.Alonzo.TxAuxData ( + AlonzoEraTxAuxData (..), AlonzoTxAuxData (..), getAlonzoTxAuxDataScripts, mkAlonzoTxAuxData,