diff --git a/cabal.project b/cabal.project index 1eedce77dd9..f73e33f53e7 100644 --- a/cabal.project +++ b/cabal.project @@ -46,7 +46,7 @@ index-state: -- Bump this if you need newer packages from Hackage , hackage.haskell.org 2024-11-20T00:00:00Z -- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2024-11-05T09:09:23Z + , cardano-haskell-packages 2024-11-27T20:49:28Z packages: eras/allegra/impl diff --git a/eras/alonzo/impl/cardano-ledger-alonzo.cabal b/eras/alonzo/impl/cardano-ledger-alonzo.cabal index 9167e1a0b3e..7fd0fac7740 100644 --- a/eras/alonzo/impl/cardano-ledger-alonzo.cabal +++ b/eras/alonzo/impl/cardano-ledger-alonzo.cabal @@ -90,7 +90,7 @@ library mtl, microlens, nothunks, - plutus-ledger-api >=1.33, + plutus-ledger-api >=1.37, set-algebra >=1.0, small-steps >=1.1, text, diff --git a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Translation/TranslationInstance.hs b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Translation/TranslationInstance.hs index cfaa1d29573..b027188412f 100644 --- a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Translation/TranslationInstance.hs +++ b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Translation/TranslationInstance.hs @@ -94,6 +94,7 @@ instance Cborg.Serialise PV3.GovernanceAction instance Cborg.Serialise PV3.GovernanceActionId instance Cborg.Serialise PV3.HotCommitteeCredential instance Cborg.Serialise PV3.Lovelace +instance Cborg.Serialise PV3.MintValue instance Cborg.Serialise PV3.OutputDatum instance Cborg.Serialise PV3.POSIXTime instance Cborg.Serialise PV3.ProposalProcedure diff --git a/eras/conway/impl/cardano-ledger-conway.cabal b/eras/conway/impl/cardano-ledger-conway.cabal index 51a6a43f9ce..11f5a54f25f 100644 --- a/eras/conway/impl/cardano-ledger-conway.cabal +++ b/eras/conway/impl/cardano-ledger-conway.cabal @@ -101,7 +101,7 @@ library deepseq, microlens, nothunks, - plutus-ledger-api >=1.33, + plutus-ledger-api >=1.37, set-algebra, small-steps >=1.1, text, diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs index 56e9faceeca..dcc112a06f4 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs @@ -92,6 +92,7 @@ import Cardano.Ledger.Crypto (Crypto) import Cardano.Ledger.DRep (DRep (..)) import Cardano.Ledger.Keys (KeyRole (..), unVRFVerKeyHash) import Cardano.Ledger.Mary (MaryValue) +import Cardano.Ledger.Mary.Value (MultiAsset) import Cardano.Ledger.Plutus.Data (Data) import Cardano.Ledger.Plutus.Language (Language (..), PlutusArgs (..)) import Cardano.Ledger.Plutus.ToPlutusData (ToPlutusData (..)) @@ -127,6 +128,7 @@ import NoThunks.Class (NoThunks) import qualified PlutusLedgerApi.V1 as PV1 import qualified PlutusLedgerApi.V2 as PV2 import qualified PlutusLedgerApi.V3 as PV3 +import qualified PlutusLedgerApi.V3.MintValue as PV3 instance Crypto c => EraPlutusContext (ConwayEra c) where type ContextError (ConwayEra c) = ConwayContextError (ConwayEra c) @@ -450,7 +452,7 @@ instance Crypto c => EraPlutusTxInfo 'PlutusV3 (ConwayEra c) where , PV3.txInfoOutputs = outputs , PV3.txInfoReferenceInputs = refInputs , PV3.txInfoFee = transCoinToLovelace (txBody ^. feeTxBodyL) - , PV3.txInfoMint = Alonzo.transMultiAsset (txBody ^. mintTxBodyL) + , PV3.txInfoMint = transMintValue (txBody ^. mintTxBodyL) , PV3.txInfoTxCerts = txCerts , PV3.txInfoWdrl = transTxBodyWithdrawals txBody , PV3.txInfoValidRange = timeRange @@ -482,6 +484,9 @@ transTxBodyId txBody = PV3.TxId (transSafeHash (hashAnnotated txBody)) transTxIn :: TxIn c -> PV3.TxOutRef transTxIn (TxIn txid txIx) = PV3.TxOutRef (transTxId txid) (toInteger (txIxToInt txIx)) +transMintValue :: MultiAsset c -> PV3.MintValue +transMintValue = PV3.UnsafeMintValue . PV1.getValue . Alonzo.transMultiAsset + -- | Translate all `Withdrawal`s from within a `TxBody` transTxBodyWithdrawals :: EraTxBody era => TxBody era -> PV3.Map PV3.Credential PV3.Lovelace transTxBodyWithdrawals txBody = diff --git a/flake.lock b/flake.lock index fa00a0cce70..6650f8b2fb8 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1731401651, - "narHash": "sha256-tXaUck9+0Ob4h6GBlbhYMI4ekW5e8biVJU5jPT/rjus=", + "lastModified": 1732742574, + "narHash": "sha256-XUhDWQeChjNPcYluz8sCbs5vW+3jEYysxEhpKdFXbt0=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "82b295d6147a566c28dbcf038c54040f06f7e6b4", + "rev": "375a4694472aa362b7abba0e8b7f3de787e90c91", "type": "github" }, "original": { diff --git a/libs/plutus-preprocessor/plutus-preprocessor.cabal b/libs/plutus-preprocessor/plutus-preprocessor.cabal index 5b331313c9e..aceee0f5f7c 100644 --- a/libs/plutus-preprocessor/plutus-preprocessor.cabal +++ b/libs/plutus-preprocessor/plutus-preprocessor.cabal @@ -40,7 +40,7 @@ library cardano-ledger-binary:testlib, plutus-tx, plutus-tx-plugin, - plutus-ledger-api, + plutus-ledger-api >=1.37, template-haskell if ((impl(ghc <9.6) || impl(ghc >=9.7)) || os(windows)) diff --git a/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs b/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs index 4abe18b7960..36508ac635a 100644 --- a/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs +++ b/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs @@ -127,7 +127,7 @@ purposeIsWellformedNoDatumQ = PV3.ScriptContext txInfo _redeemer scriptInfo -> case scriptInfo of PV3.MintingScript cs -> - PAM.member cs $ PV3.getValue $ PV3.txInfoMint txInfo + PAM.member cs $ PV3.getValue . PV3.mintValueMinted $ PV3.txInfoMint txInfo -- Expecting No Datum, therefore should fail when it is supplied PV3.SpendingScript txOutRef mDatum -> case mDatum of