diff --git a/.changes/reexport-txauxdata-accessors.yml b/.changes/reexport-txauxdata-accessors.yml new file mode 100644 index 0000000000..ed504331ac --- /dev/null +++ b/.changes/reexport-txauxdata-accessors.yml @@ -0,0 +1,6 @@ +project: cardano-api +pr: 1262 +kind: + - compatible +description: | + Re-export additional ledger accessors from `Cardano.Api.Ledger` so downstream code can read a transaction and its outputs through the ledger lenses without depending on `cardano-ledger` directly: `auxDataTxL` (via `EraTx`), `metadataTxAuxDataL` (via `EraTxAuxData`), `addrTxOutL` / `valueTxOutL` (via `EraTxOut`), `datumTxOutF` (via `AlonzoEraTxOut`), plus `Datum (..)`, `hashBinaryData`, and `hashScript`. diff --git a/cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs b/cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs index 2b6ce58c43..defc18a6eb 100644 --- a/cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs +++ b/cardano-api/src/Cardano/Api/Ledger/Internal/Reexport.hs @@ -51,7 +51,7 @@ module Cardano.Api.Ledger.Internal.Reexport , toCompactPartial , EraPParams (..) , Era (..) - , EraTxOut + , EraTxOut (addrTxOutL, valueTxOutL) , Inject (..) , Network (..) , PoolCert (..) @@ -151,6 +151,10 @@ module Cardano.Api.Ledger.Internal.Reexport , AsIx (..) , CoinPerWord (..) , Data (..) + , Datum (..) + , AlonzoEraTxOut (datumTxOutF) + , hashBinaryData + , hashScript , EraTxWits (..) , ExUnits (..) , Redeemers (..) @@ -163,7 +167,8 @@ module Cardano.Api.Ledger.Internal.Reexport , pattern AlonzoGenesis , AsIxItem (..) , EraGov - , EraTx (witsTxL, bodyTxL) + , EraTx (witsTxL, bodyTxL, auxDataTxL) + , EraTxAuxData (metadataTxAuxDataL) , EraTxBody (..) , TopTx , Tx @@ -223,12 +228,13 @@ import Cardano.Ledger.Allegra.Scripts (AllegraEraScript (..), Timelock (..), sho import Cardano.Ledger.Alonzo.Core ( AlonzoEraScript (..) , AlonzoEraTxBody (..) + , AlonzoEraTxOut (datumTxOutF) , AlonzoEraTxWits (..) , AsIx (..) , AsIxItem (AsIxItem) , CoinPerWord (..) , EraGov - , EraTx (bodyTxL, witsTxL) + , EraTx (auxDataTxL, bodyTxL, witsTxL) , EraTxWits (..) , PParamsUpdate (..) , Tx @@ -347,14 +353,16 @@ import Cardano.Ledger.Conway.TxCert import Cardano.Ledger.Core ( Era (..) , EraPParams (..) + , EraTxAuxData (metadataTxAuxDataL) , EraTxBody (..) - , EraTxOut + , EraTxOut (addrTxOutL, valueTxOutL) , PParams (..) , PoolCert (..) , TopTx , TxOut , Value , fromEraCBOR + , hashScript , mkBasicTxOut , ppMinFeeAL , ppMinUTxOValueL @@ -381,7 +389,7 @@ import Cardano.Ledger.Keys , toVRFVerKeyHash ) import Cardano.Ledger.Mary.Value (MaryValue (..), MultiAsset (..), PolicyID (..), valueFromList) -import Cardano.Ledger.Plutus.Data (Data (..), unData) +import Cardano.Ledger.Plutus.Data (Data (..), Datum (..), hashBinaryData, unData) import Cardano.Ledger.Plutus.Language ( Language , Plutus diff --git a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs index c413d5e3c7..7ff911c9fe 100644 --- a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs +++ b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs @@ -36,7 +36,6 @@ import Cardano.Ledger.Conway qualified as L import Cardano.Ledger.Core qualified as L import Cardano.Ledger.Dijkstra.Genesis (DijkstraGenesis (..)) import Cardano.Ledger.Mary.Value qualified as Mary -import Cardano.Ledger.Plutus.Data qualified as L import Cardano.Ledger.Plutus.Language qualified as Plutus import Cardano.Slotting.EpochInfo qualified as Slotting import Cardano.Slotting.Slot qualified as Slotting diff --git a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Body/Plutus/Scripts.hs b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Body/Plutus/Scripts.hs index 88a698f83a..2ca5e5070a 100644 --- a/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Body/Plutus/Scripts.hs +++ b/cardano-api/test/cardano-api-test/Test/Cardano/Api/Transaction/Body/Plutus/Scripts.hs @@ -21,7 +21,6 @@ import Cardano.Api.Serialise.Cbor (SerialiseAsCBOR (..)) import Cardano.Ledger.Conway qualified as L import Cardano.Ledger.Conway.Scripts qualified as L -import Cardano.Ledger.Core qualified as L import Cardano.Ledger.Dijkstra.Scripts qualified as L import Cardano.Ledger.Plutus.Language qualified as L