Skip to content

Update plutus to 1.13 #3738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ index-state:
-- Bump this if you need newer packages from Hackage
, hackage.haskell.org 2023-07-17T00:00:00Z
-- Bump this if you need newer packages from CHaP
, cardano-haskell-packages 2023-08-26T00:00:00Z
, cardano-haskell-packages 2023-09-18T17:20:55Z


packages:
eras/allegra/impl
Expand Down
4 changes: 2 additions & 2 deletions eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ library
mtl,
microlens,
nothunks,
plutus-ledger-api ^>=1.11,
plutus-core ^>=1.11,
plutus-ledger-api ^>=1.13,
plutus-core ^>=1.13,
prettyprinter,
serialise,
set-algebra >=1.0,
Expand Down
8 changes: 4 additions & 4 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ import qualified Data.Map.Strict as Map
import Data.Measure (BoundedMeasure, Measure)
import Data.Scientific (fromRationalRepetendLimited)
import Data.Semigroup (All (..))
import Data.Text as T (Text, pack)
import Data.Text as T (Text)
import Data.Word (Word64, Word8)
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks (..), allNoThunks)
Expand Down Expand Up @@ -412,9 +412,9 @@ plutusV1ParamNames =
]

plutusVXParamNames :: Language -> [Text]
plutusVXParamNames PlutusV1 = T.pack . Plutus.showParamName <$> [minBound .. maxBound :: PV1.ParamName]
plutusVXParamNames PlutusV2 = T.pack . Plutus.showParamName <$> [minBound .. maxBound :: PV2.ParamName]
plutusVXParamNames PlutusV3 = T.pack . Plutus.showParamName <$> [minBound .. maxBound :: PV3.ParamName]
plutusVXParamNames PlutusV1 = Plutus.showParamName <$> [minBound .. maxBound :: PV1.ParamName]
plutusVXParamNames PlutusV2 = Plutus.showParamName <$> [minBound .. maxBound :: PV2.ParamName]
plutusVXParamNames PlutusV3 = Plutus.showParamName <$> [minBound .. maxBound :: PV3.ParamName]

validateCostModel :: MonadFail m => Language -> [Integer] -> m CostModel
validateCostModel lang cmps =
Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ library
data-default-class,
microlens,
plutus-tx,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.11,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.13,
QuickCheck,
random,
serialise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ import Cardano.Ledger.Alonzo.Language (BinaryPlutus (..), Language (..), Plutus
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript (PlutusScript), CostModel, mkCostModel)
import Data.ByteString.Short (pack)
import Data.Either (fromRight)
import qualified Data.Map as Map
import PlutusLedgerApi.Test.EvaluationContext (costModelParamsForTesting)
import PlutusLedgerApi.Test.V3.EvaluationContext (costModelParamsForTesting)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import PlutusLedgerApi.Test.V3.EvaluationContext (costModelParamsForTesting)
import qualified PlutusLedgerApi.Test.V1.EvaluationContext as PV1 (costModelParamsForTesting)
import qualified PlutusLedgerApi.Test.V2.EvaluationContext as PV2 (costModelParamsForTesting)


testingCostModelV1 :: CostModel
testingCostModelV1 =
fromRight (error "testingCostModelV1 is not well-formed") $
mkCostModel PlutusV1 (0 <$ Map.elems costModelParamsForTesting)
mkCostModel PlutusV1 (0 <$ costModelParamsForTesting)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are now plutus version specific testing functions, which shoul dbe used instead of all using PlutusV3 version

Suggested change
mkCostModel PlutusV1 (0 <$ costModelParamsForTesting)
mkCostModel PlutusV1 (0 <$ PV1.costModelParamsForTesting)


testingCostModelV2 :: CostModel
testingCostModelV2 =
fromRight (error "testingCostModelV2 is not well-formed") $
mkCostModel PlutusV2 (0 <$ Map.elems costModelParamsForTesting)
mkCostModel PlutusV2 (0 <$ costModelParamsForTesting)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here:

Suggested change
mkCostModel PlutusV2 (0 <$ costModelParamsForTesting)
mkCostModel PlutusV2 (0 <$ PV1.costModelParamsForTesting)


{- Preproceesed Plutus Script
guessTheNumber'2_0 :: PlutusTx.Builtins.Internal.BuiltinData ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import qualified PlutusLedgerApi.V3 as PV3
-- FIXME: remove following line after plutus patch

import Cardano.Ledger.Alonzo.TxInfo (VersionedTxInfo)
import qualified PlutusLedgerApi.V3.Contexts as PV3
import PlutusTx.Ratio as PlutusTx

import Data.Typeable (Typeable)
Expand Down Expand Up @@ -113,9 +112,6 @@ instance Cborg.Serialise a => Cborg.Serialise (PV3.Interval a)
instance Cborg.Serialise a => Cborg.Serialise (PV3.LowerBound a)
instance Cborg.Serialise a => Cborg.Serialise (PV3.UpperBound a)

-- FIXME: remove following line after plutus patch
deriving instance Generic PV3.BuiltinData

-- FIXME: fix following after plutus patch
instance Cborg.Serialise PlutusTx.Rational where
encode = error "fixme rational"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import Cardano.Ledger.Alonzo.TxInfo (
import Cardano.Ledger.BaseTypes (ProtVer (..), natVersion)
import Cardano.Ledger.Language (BinaryPlutus (..), Language (..), Plutus (..))
import Data.ByteString.Short (ShortByteString)
import PlutusLedgerApi.Test.EvaluationContext
import PlutusLedgerApi.Test.Examples (
alwaysFailingNAryFunction,
alwaysSucceedingNAryFunction,
)
import PlutusLedgerApi.Test.V3.EvaluationContext
import qualified PlutusLedgerApi.V1 as PV1
import Test.Cardano.Ledger.Alonzo.PlutusScripts (testingCostModelV1)
import qualified Test.Cardano.Ledger.Alonzo.PlutusScripts as Generated (
Expand Down
2 changes: 1 addition & 1 deletion eras/babbage/impl/cardano-ledger-babbage.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ library
deepseq,
microlens,
nothunks,
plutus-ledger-api ^>=1.11,
plutus-ledger-api ^>=1.13,
set-algebra,
small-steps,
text,
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 @@ -83,7 +83,7 @@ library
deepseq,
microlens,
nothunks,
plutus-ledger-api ^>=1.11,
plutus-ledger-api ^>=1.13,
set-algebra,
small-steps,
text,
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/cardano-ledger-binary/cardano-ledger-binary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ library
network,
nothunks,
primitive,
plutus-ledger-api ^>=1.11,
plutus-ledger-api ^>=1.13,
recursion-schemes,
serialise,
tagged,
Expand Down
2 changes: 1 addition & 1 deletion libs/cardano-ledger-test/cardano-ledger-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ library
nothunks,
plutus-core,
hspec,
plutus-ledger-api ^>=1.11,
plutus-ledger-api ^>=1.13,
prettyprinter,
QuickCheck,
small-steps,
Expand Down