Skip to content

Commit

Permalink
Merge pull request #4777 from IntersectMBO/nm/plutus-1.37
Browse files Browse the repository at this point in the history
Upgrade to plutus-ledger-api 1.37.0.0
  • Loading branch information
lehins authored Nov 29, 2024
2 parents 33e90ea + 75c4006 commit 730c811
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eras/conway/impl/cardano-ledger-conway.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (..))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/plutus-preprocessor/plutus-preprocessor.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 730c811

Please sign in to comment.