diff --git a/cabal.project b/cabal.project index 54fbf403229..e3ebd16c87f 100644 --- a/cabal.project +++ b/cabal.project @@ -14,9 +14,10 @@ repository cardano-haskell-packages -- update either of these. index-state: 2023-04-28T00:00:00Z index-state: - , hackage.haskell.org 2023-04-28T00:00:00Z --- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2023-05-09T09:56:38Z + -- Bump this if you need newer packages from Hackage + , hackage.haskell.org 2023-05-28T23:23:01Z + -- Bump this if you need newer packages from CHaP + , cardano-haskell-packages 2023-05-28T23:23:01Z packages: eras/allegra/impl @@ -86,14 +87,32 @@ benchmarks: true -- The only sensible test display option test-show-details: streaming +constraints: + -- Earlier versions have a slightly different set of type constraints. + persistent >= 2.14 + + +if impl(ghc >= 9.6) + allow-newer: + , *:base + , *:ghc-prim + , *:template-haskell + -- https://github.com/yesodweb/persistent/pull/1499 + , persistent:* + -- https://github.com/protolude/protolude/pull/143 + , protolude:* + + -- https://github.com/kowainik/validation-selective/issues/76 + , validation-selective:selective + -- This is an unreleased version of `weigh` that includes `WallTime`. -- It's okay for us to have this since it's only our benchmarks -- that depend on `weigh`, not our released packages. source-repository-package type: git - location: https://github.com/fpco/weigh.git - tag: bfcf4415144d7d2817dfcb91b6f9a6dfd7236de7 - --sha256: 01fy4nbq6kaqi73ydn6w7rd1izkg5p217q5znyp2icybf41sl1b6 + location: https://github.com/input-output-hk/weigh + tag: c67fb1a84e78cb1b81d078f2df9c76a6382b5e00 + --sha256: 0bksg3nm002yv1kf9irb574qj2fdlif4bhfq54fygm7xj118mjpr -- https://github.com/well-typed/cborg/pull/301 source-repository-package @@ -103,3 +122,36 @@ source-repository-package --sha256: 18apsg2lqjv9cc29nbd3hzj2hqhksqjj0s4xp2rdv8cbd27racjh subdir: cborg + + +-- https://github.com/mokus0/th-extras/pull/21 +source-repository-package + type: git + location: https://github.com/erikd/th-extras + tag: fa8a2855883220480b80ca0d8224e9c3a8cd2c4a + --sha256: 1fdbjjc0icyi1zh7j9sx8qfh0hk88mg0211dmyx0wyzkgz27bbzq + +-- https://github.com/kowainik/validation-selective/pull/77 +source-repository-package + type: git + location: https://github.com/erikd/validation-selective + tag: 3066eebc6718062e4c6b02369663f3c28f5e9b65 + --sha256: 0gk96wkb1gf8qwqv7v30vnzs5sq6v57ay55wjlxb28r3y07ymd9k + +-- HEAD builds but has not yet been released to Hackage +-- https://github.com/haskell-streaming/streaming/issues/119 +source-repository-package + type: git + location: https://github.com/haskell-streaming/streaming + tag: 0c815bf9043d0f0cbda92b80ef791892e2b7fb43 + --sha256: 0q01mvag2f2xw8dnk6v7dq26gw8zvskgax39ljbf7pblm6n2c4wk + +-- https://github.com/yesodweb/persistent/pull/1499 +source-repository-package + type: git + location: https://github.com/erikd/persistent + tag: 3cf614e5044862d0733f55fd39623d73a8e5469e + --sha256: 076il4h2pcfpfd0l0vrdynbpascq5yv8an8g4lw41xmj4bzfwlj8 + subdir: + persistent + persistent-sqlite diff --git a/eras/allegra/impl/cardano-ledger-allegra.cabal b/eras/allegra/impl/cardano-ledger-allegra.cabal index e39dbf856de..6c19e78220d 100644 --- a/eras/allegra/impl/cardano-ledger-allegra.cabal +++ b/eras/allegra/impl/cardano-ledger-allegra.cabal @@ -48,7 +48,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-crypto-class, cardano-ledger-binary >=1.0, diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Core.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Core.hs index 78501e922e7..145056ea133 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Core.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Core.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Allegra.Core ( AllegraEraTxBody (..), diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs index 003baab3fe3..494624daa76 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxo.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxow.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxow.hs index c04aeef871a..276371e6287 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxow.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Rules/Utxow.hs @@ -4,6 +4,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs index 8431e86e364..b4a815845c9 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs @@ -13,6 +13,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxAuxData.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxAuxData.hs index 55952e84114..420664efd66 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxAuxData.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxAuxData.hs @@ -11,6 +11,7 @@ {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxBody.hs b/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxBody.hs index 182cef27222..0cb23ef00fb 100644 --- a/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxBody.hs +++ b/eras/allegra/impl/src/Cardano/Ledger/Allegra/TxBody.hs @@ -11,6 +11,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/cardano-ledger-alonzo.cabal b/eras/alonzo/impl/cardano-ledger-alonzo.cabal index 9c2c669ab71..35b89be290d 100644 --- a/eras/alonzo/impl/cardano-ledger-alonzo.cabal +++ b/eras/alonzo/impl/cardano-ledger-alonzo.cabal @@ -58,7 +58,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson >=2, base-deriving-via, base64-bytestring, @@ -81,8 +81,8 @@ library mtl, microlens, nothunks, - plutus-ledger-api ^>=1.6, - plutus-core ^>=1.6, + plutus-ledger-api ^>=1.7, + plutus-core ^>=1.7, prettyprinter, serialise, set-algebra >=1.0, diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs index e18e7da52a1..612fa9815d9 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Core.hs @@ -5,6 +5,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Alonzo.Core ( AlonzoEraTxOut (..), diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs index 639dae6f4fc..ffb7548483a 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Cardano.Ledger.Alonzo.PlutusScriptApi ( diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs index 93e57260d4e..ac816ba59e7 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Bbody.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Ledger.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Ledger.hs index 7525db21fce..62e58de83cd 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Ledger.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Ledger.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs index 992b27aaa92..50e5c6b8627 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs @@ -11,6 +11,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs index 842d6c414a4..954a118bd2d 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxos.hs @@ -12,6 +12,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs index a1604775433..263053721a7 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxow.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs index 4fce7aec549..1d433446346 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs @@ -15,6 +15,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts/Data.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts/Data.hs index b376298f643..b6f7f13cde9 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts/Data.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts/Data.hs @@ -15,6 +15,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} -- This is needed for the `HeapWords (StrictMaybe (DataHash c))` instance diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs index f0763f766d1..dc156c90a2a 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs @@ -15,7 +15,9 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | This module exports implementations of many of the functions outlined in the Alonzo specification. diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs index f76a07f2f90..76704496a11 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs @@ -15,6 +15,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs index 536d2372b5a..dc47d389dd9 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs @@ -13,7 +13,9 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Alonzo.TxInfo ( TxOutSource (..), diff --git a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs index 9d70f376f82..1e0ba8bc34a 100644 --- a/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs +++ b/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs @@ -13,7 +13,9 @@ {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Arbitrary.hs b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Arbitrary.hs index 4b2950f5df9..cf049966c79 100644 --- a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Arbitrary.hs +++ b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Arbitrary.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal b/eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal index 028963b95e6..11b82a71f7a 100644 --- a/eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal +++ b/eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal @@ -47,7 +47,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} >=1.2, cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0, @@ -66,7 +66,7 @@ library data-default-class, microlens, plutus-tx, - plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.6, + plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.7, QuickCheck, random, serialise, diff --git a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs index e203d761033..02d07559d20 100644 --- a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs +++ b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/AlonzoEraGen.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Trace.hs b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Trace.hs index 9866ccd305f..a2fede426f0 100644 --- a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Trace.hs +++ b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Trace.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- HasTrace instances for AlonzoLEDGE {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Translation/TranslatableGen.hs b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Translation/TranslatableGen.hs index 38e3d8872e1..71203209649 100644 --- a/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Translation/TranslatableGen.hs +++ b/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/Translation/TranslatableGen.hs @@ -3,6 +3,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Test.Cardano.Ledger.Alonzo.Translation.TranslatableGen ( TranslatableGen (..), diff --git a/eras/babbage/impl/cardano-ledger-babbage.cabal b/eras/babbage/impl/cardano-ledger-babbage.cabal index eb0f95ad18a..094c762d131 100644 --- a/eras/babbage/impl/cardano-ledger-babbage.cabal +++ b/eras/babbage/impl/cardano-ledger-babbage.cabal @@ -53,7 +53,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, bytestring, cardano-crypto-class, @@ -70,7 +70,7 @@ library deepseq, microlens, nothunks, - plutus-ledger-api ^>=1.6, + plutus-ledger-api ^>=1.7, set-algebra, small-steps, text, diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Core.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Core.hs index 1d0995b6595..cbbaf458636 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Core.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Core.hs @@ -3,6 +3,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Babbage.Core ( BabbageEraTxOut (..), diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs index 4738aeecba1..2bde22650fb 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs @@ -12,6 +12,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Ledger.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Ledger.hs index 2fc307744d4..79d8923da49 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Ledger.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Ledger.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs index e17f60a3ed7..c07eed74025 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxos.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxos.hs index c5d3117aab1..490115ee0a7 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxos.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxos.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs index 9ef17af6e92..dd421a48025 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxow.hs @@ -6,6 +6,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Scripts.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Scripts.hs index 4ae1c63b742..eab381fbc6c 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/Scripts.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/Scripts.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Figure 3: Functions related to scripts diff --git a/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs b/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs index b30d3c6b1f9..bddb66beace 100644 --- a/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs +++ b/eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Babbage.TxInfo where diff --git a/eras/babbage/test-suite/cardano-ledger-babbage-test.cabal b/eras/babbage/test-suite/cardano-ledger-babbage-test.cabal index f4eeda2cac9..3a1e26a29c9 100644 --- a/eras/babbage/test-suite/cardano-ledger-babbage-test.cabal +++ b/eras/babbage/test-suite/cardano-ledger-babbage-test.cabal @@ -35,7 +35,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, cardano-ledger-allegra >=1.1, cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} ^>=1.3, diff --git a/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/Translation/TranslatableGen.hs b/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/Translation/TranslatableGen.hs index 56e58bb00c4..932c12b1205 100644 --- a/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/Translation/TranslatableGen.hs +++ b/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/Translation/TranslatableGen.hs @@ -3,6 +3,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Test.Cardano.Ledger.Babbage.Translation.TranslatableGen ( diff --git a/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/TxInfo.hs b/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/TxInfo.hs index ee20d65c326..720fa80bc5a 100644 --- a/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/TxInfo.hs +++ b/eras/babbage/test-suite/src/Test/Cardano/Ledger/Babbage/TxInfo.hs @@ -2,6 +2,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Babbage.TxInfo where diff --git a/eras/byron/chain/executable-spec/byron-spec-chain.cabal b/eras/byron/chain/executable-spec/byron-spec-chain.cabal index 0ef9aa107bd..1749d3b3e85 100644 --- a/eras/byron/chain/executable-spec/byron-spec-chain.cabal +++ b/eras/byron/chain/executable-spec/byron-spec-chain.cabal @@ -27,7 +27,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bimap >=0.4 && <0.5, bytestring, containers, diff --git a/eras/byron/crypto/cardano-crypto-wrapper.cabal b/eras/byron/crypto/cardano-crypto-wrapper.cabal index 0a90d9fa00a..e5bff17af40 100644 --- a/eras/byron/crypto/cardano-crypto-wrapper.cabal +++ b/eras/byron/crypto/cardano-crypto-wrapper.cabal @@ -73,7 +73,7 @@ library -Wno-safe -Wno-unsafe -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, base16-bytestring >=1, base64-bytestring, diff --git a/eras/byron/crypto/test/cardano-crypto-test.cabal b/eras/byron/crypto/test/cardano-crypto-test.cabal index c65c19d6c49..6eebb78cb92 100644 --- a/eras/byron/crypto/test/cardano-crypto-test.cabal +++ b/eras/byron/crypto/test/cardano-crypto-test.cabal @@ -51,7 +51,7 @@ library -Wno-safe -Wno-unsafe -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0, cardano-crypto, diff --git a/eras/byron/ledger/executable-spec/byron-spec-ledger.cabal b/eras/byron/ledger/executable-spec/byron-spec-ledger.cabal index 6bf2373b771..e03cd0b6c39 100644 --- a/eras/byron/ledger/executable-spec/byron-spec-ledger.cabal +++ b/eras/byron/ledger/executable-spec/byron-spec-ledger.cabal @@ -36,7 +36,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bimap >=0.4 && <0.5, bytestring, cardano-crypto-class, diff --git a/eras/byron/ledger/impl/cardano-ledger-byron.cabal b/eras/byron/ledger/impl/cardano-ledger-byron.cabal index 8db93d0ce56..f7617aa69b2 100644 --- a/eras/byron/ledger/impl/cardano-ledger-byron.cabal +++ b/eras/byron/ledger/impl/cardano-ledger-byron.cabal @@ -227,7 +227,7 @@ library -Wno-safe -Wno-unsafe -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, base58-bytestring, bimap >=0.4 && <0.5, diff --git a/eras/byron/ledger/impl/src/Cardano/Chain/Update/Proposal.hs b/eras/byron/ledger/impl/src/Cardano/Chain/Update/Proposal.hs index 345bfea3059..f1093d57271 100644 --- a/eras/byron/ledger/impl/src/Cardano/Chain/Update/Proposal.hs +++ b/eras/byron/ledger/impl/src/Cardano/Chain/Update/Proposal.hs @@ -59,19 +59,14 @@ import Cardano.Crypto ( serializeCborHash, ) import Cardano.Ledger.Binary ( - Annotated (..), ByteSpan, DecCBOR (..), Decoded (..), EncCBOR (..), FromCBOR (..), ToCBOR (..), - annotatedDecoder, - encodeListLen, - enforceSize, - fromByronCBOR, - toByronCBOR, ) +import qualified Cardano.Ledger.Binary as Binary import Cardano.Prelude import Data.Aeson (ToJSON) import qualified Data.Map.Strict as M @@ -88,7 +83,7 @@ type UpId = Hash Proposal -- | Proposal for software update data AProposal a = AProposal - { aBody :: !(Annotated ProposalBody a) + { aBody :: !(Binary.Annotated ProposalBody a) , issuer :: !VerificationKey -- ^ Who proposed this UP. , signature :: !(Signature ProposalBody) @@ -124,14 +119,14 @@ signatureForProposal protocolMagicId proposalBody safeSigner = -- | Create an update 'Proposal' using the provided signature. unsafeProposal :: ProposalBody -> VerificationKey -> Signature ProposalBody -> Proposal -unsafeProposal b k s = AProposal (Annotated b ()) k s () +unsafeProposal b k s = AProposal (Binary.Annotated b ()) k s () -------------------------------------------------------------------------------- -- Proposal Accessors -------------------------------------------------------------------------------- body :: AProposal a -> ProposalBody -body = unAnnotated . aBody +body = Binary.unAnnotated . aBody recoverUpId :: AProposal ByteString -> UpId recoverUpId = hashDecoded @@ -141,14 +136,14 @@ recoverUpId = hashDecoded -------------------------------------------------------------------------------- instance ToCBOR Proposal where - toCBOR = toByronCBOR + toCBOR = Binary.toByronCBOR instance FromCBOR Proposal where - fromCBOR = fromByronCBOR + fromCBOR = Binary.fromByronCBOR instance EncCBOR Proposal where encCBOR proposal = - encodeListLen 7 + Binary.encodeListLen 7 <> encCBOR (protocolVersion body') <> encCBOR (protocolParametersUpdate body') <> encCBOR (softwareVersion body') @@ -163,14 +158,14 @@ instance DecCBOR Proposal where decCBOR = void <$> decCBOR @(AProposal ByteSpan) instance FromCBOR (AProposal ByteSpan) where - fromCBOR = fromByronCBOR + fromCBOR = Binary.fromByronCBOR instance DecCBOR (AProposal ByteSpan) where decCBOR = do - Annotated (pb, vk, sig) byteSpan <- annotatedDecoder $ do - enforceSize "Proposal" 7 + Binary.Annotated (pb, vk, sig) byteSpan <- Binary.annotatedDecoder $ do + Binary.enforceSize "Proposal" 7 pb <- - annotatedDecoder + Binary.annotatedDecoder ( ProposalBody <$> decCBOR <*> decCBOR @@ -238,14 +233,14 @@ instance ToJSON ProposalBody -------------------------------------------------------------------------------- instance ToCBOR ProposalBody where - toCBOR = toByronCBOR + toCBOR = Binary.toByronCBOR instance FromCBOR ProposalBody where - fromCBOR = fromByronCBOR + fromCBOR = Binary.fromByronCBOR instance EncCBOR ProposalBody where encCBOR pb = - encodeListLen 5 + Binary.encodeListLen 5 <> encCBOR (protocolVersion pb) <> encCBOR (protocolParametersUpdate pb) <> encCBOR (softwareVersion pb) @@ -255,7 +250,7 @@ instance EncCBOR ProposalBody where instance DecCBOR ProposalBody where decCBOR = do - enforceSize "ProposalBody" 5 + Binary.enforceSize "ProposalBody" 5 ProposalBody <$> decCBOR <*> decCBOR @@ -266,5 +261,5 @@ instance DecCBOR ProposalBody where -- | Prepend byte corresponding to `encodeListLen 5`, which was used during -- signing recoverProposalSignedBytes :: - Annotated ProposalBody ByteString -> Annotated ProposalBody ByteString + Binary.Annotated ProposalBody ByteString -> Binary.Annotated ProposalBody ByteString recoverProposalSignedBytes = fmap ("\133" <>) diff --git a/eras/byron/ledger/impl/test/cardano-ledger-byron-test.cabal b/eras/byron/ledger/impl/test/cardano-ledger-byron-test.cabal index d25a8a21300..1c2d063018d 100644 --- a/eras/byron/ledger/impl/test/cardano-ledger-byron-test.cabal +++ b/eras/byron/ledger/impl/test/cardano-ledger-byron-test.cabal @@ -179,7 +179,7 @@ library -Wno-safe -Wno-unsafe -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, base16-bytestring >=1, bimap, bytestring, diff --git a/eras/conway/impl/cardano-ledger-conway.cabal b/eras/conway/impl/cardano-ledger-conway.cabal index 712865503b8..aa97ffcef4d 100644 --- a/eras/conway/impl/cardano-ledger-conway.cabal +++ b/eras/conway/impl/cardano-ledger-conway.cabal @@ -57,7 +57,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, bytestring, cardano-crypto-class, @@ -75,7 +75,7 @@ library deepseq, microlens, nothunks, - plutus-ledger-api ^>=1.6, + plutus-ledger-api ^>=1.7, set-algebra, small-steps, text, diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Core.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Core.hs index 89b22c7ab22..49febfb0bf6 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Core.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Core.hs @@ -3,6 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Conway.Core ( module X, diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs index 1ccf5775661..4a6f24adb40 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Delegs.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Delegs.hs index 4714ddf1811..903be8ad244 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Delegs.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Delegs.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Enact.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Enact.hs index dd2406d52b0..6f3bbd58061 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Enact.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Enact.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs index cc694bd9335..df2f71ee737 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ledger.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ledger.hs index 20cb2201ad2..1d41a49854f 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ledger.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ledger.hs @@ -10,6 +10,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/NewEpoch.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/NewEpoch.hs index 6af57241228..d8af8252bbf 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/NewEpoch.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/NewEpoch.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ratify.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ratify.hs index 9ec573dcc18..78b173bc2ef 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ratify.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Ratify.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tally.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tally.hs index d0d6085abee..1ede723b274 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tally.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tally.hs @@ -15,6 +15,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tickf.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tickf.hs index 3943df17bcc..71b60bfedbe 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tickf.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Tickf.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Conway.Rules.Tickf ( diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxos.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxos.hs index 1cf25cd676b..ffdd121d602 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxos.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Utxos.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs index cf21a69c3bd..27bc74c0664 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs @@ -13,6 +13,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs index ab175ba7dbb..f5702362073 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs @@ -5,7 +5,9 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Conway.TxCert ( diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs index 75da7d89e4f..c72ccc6838e 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Conway.TxInfo (conwayTxInfo) where diff --git a/eras/conway/test-suite/cardano-ledger-conway-test.cabal b/eras/conway/test-suite/cardano-ledger-conway-test.cabal index 64a832c652f..c207074febe 100644 --- a/eras/conway/test-suite/cardano-ledger-conway-test.cabal +++ b/eras/conway/test-suite/cardano-ledger-conway-test.cabal @@ -35,7 +35,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib} ^>=1.3, cardano-ledger-alonzo-test, cardano-ledger-babbage ^>=1.3, diff --git a/eras/mary/impl/cardano-ledger-mary.cabal b/eras/mary/impl/cardano-ledger-mary.cabal index 2fecc026ad1..549f224d3ec 100644 --- a/eras/mary/impl/cardano-ledger-mary.cabal +++ b/eras/mary/impl/cardano-ledger-mary.cabal @@ -51,7 +51,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, base16-bytestring, aeson, diff --git a/eras/mary/impl/src/Cardano/Ledger/Mary/Core.hs b/eras/mary/impl/src/Cardano/Ledger/Mary/Core.hs index 98af0384ca5..a782cce160f 100644 --- a/eras/mary/impl/src/Cardano/Ledger/Mary/Core.hs +++ b/eras/mary/impl/src/Cardano/Ledger/Mary/Core.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Mary.Core ( MaryEraTxBody (..), diff --git a/eras/mary/impl/src/Cardano/Ledger/Mary/TxBody.hs b/eras/mary/impl/src/Cardano/Ledger/Mary/TxBody.hs index 02967ed2560..5c73f68b5a8 100644 --- a/eras/mary/impl/src/Cardano/Ledger/Mary/TxBody.hs +++ b/eras/mary/impl/src/Cardano/Ledger/Mary/TxBody.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/mary/impl/src/Cardano/Ledger/Mary/UTxO.hs b/eras/mary/impl/src/Cardano/Ledger/Mary/UTxO.hs index b1d0d3e3309..f66df018fce 100644 --- a/eras/mary/impl/src/Cardano/Ledger/Mary/UTxO.hs +++ b/eras/mary/impl/src/Cardano/Ledger/Mary/UTxO.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Mary.UTxO (getConsumedMaryValue) where diff --git a/eras/shelley-ma/test-suite/cardano-ledger-shelley-ma-test.cabal b/eras/shelley-ma/test-suite/cardano-ledger-shelley-ma-test.cabal index 1e39675aec7..04acc9ec505 100644 --- a/eras/shelley-ma/test-suite/cardano-ledger-shelley-ma-test.cabal +++ b/eras/shelley-ma/test-suite/cardano-ledger-shelley-ma-test.cabal @@ -43,7 +43,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0, cardano-ledger-core:{cardano-ledger-core, testlib} >=1.3, diff --git a/eras/shelley-ma/test-suite/src/Test/Cardano/Ledger/MaryEraGen.hs b/eras/shelley-ma/test-suite/src/Test/Cardano/Ledger/MaryEraGen.hs index e91848d5778..2c3a8721c4e 100644 --- a/eras/shelley-ma/test-suite/src/Test/Cardano/Ledger/MaryEraGen.hs +++ b/eras/shelley-ma/test-suite/src/Test/Cardano/Ledger/MaryEraGen.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Allegra/ScriptTranslation.hs b/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Allegra/ScriptTranslation.hs index 90270fa9c91..61e690733de 100644 --- a/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Allegra/ScriptTranslation.hs +++ b/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Allegra/ScriptTranslation.hs @@ -12,9 +12,9 @@ import Cardano.Ledger.Shelley (Shelley) import qualified Cardano.Ledger.Shelley.API as S import Cardano.Ledger.Shelley.Core import Cardano.Ledger.Shelley.LedgerState (LedgerState (..)) -import Cardano.Ledger.Shelley.TxWits (scriptWits) import qualified Cardano.Ledger.Val as Val import Cardano.Slotting.Slot (SlotNo (..)) +import Lens.Micro ((&), (.~)) import Control.Monad.Except (runExcept) import Control.State.Transition.Extended (TRC (..)) import Data.Default.Class (def) @@ -65,7 +65,7 @@ testScriptPostTranslation = (SlotNo 1) S.SNothing S.SNothing - wits = mempty {scriptWits = Map.singleton scriptHash script} + wits = mkBasicTxWits & scriptTxWitsL .~ Map.singleton scriptHash script txs = S.ShelleyTx txb wits S.SNothing txa = fromRight . runExcept $ translateEra @Allegra () txs result = diff --git a/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Mary/Examples/MultiAssets.hs b/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Mary/Examples/MultiAssets.hs index 62e196934db..1d3a254f46d 100644 --- a/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Mary/Examples/MultiAssets.hs +++ b/eras/shelley-ma/test-suite/test/Test/Cardano/Ledger/Mary/Examples/MultiAssets.hs @@ -33,7 +33,7 @@ import Cardano.Ledger.Shelley.LedgerState (AccountState (..)) import Cardano.Ledger.Shelley.Rules (ShelleyLedgerPredFailure (..), ShelleyUtxowPredFailure (..)) import Cardano.Ledger.Shelley.Tx (ShelleyTx (..)) import Cardano.Ledger.Shelley.TxBody (ShelleyTxOut (..)) -import Cardano.Ledger.Shelley.TxWits (addrWits, scriptWits) +import Cardano.Ledger.Shelley.TxWits (addrWits) import Cardano.Ledger.Slot (SlotNo (..)) import Cardano.Ledger.TxIn (TxId, TxIn (..), mkTxInPartial) import Cardano.Ledger.UTxO (UTxO (..)) @@ -166,13 +166,11 @@ txbodySimpleEx1 = txSimpleEx1 :: ShelleyTx Mary txSimpleEx1 = - ShelleyTx - txbodySimpleEx1 - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txbodySimpleEx1) [asWitness Cast.alicePay] - , scriptWits = Map.fromList [(policyID purplePolicyId, purplePolicy)] - } - SNothing + mkBasicTx txbodySimpleEx1 + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbodySimpleEx1) [asWitness Cast.alicePay] + stw = Map.fromList [(policyID purplePolicyId, purplePolicy)] expectedUTxOSimpleEx1 :: UTxO Mary expectedUTxOSimpleEx1 = @@ -217,10 +215,10 @@ txbodySimpleEx2 = txSimpleEx2 :: ShelleyTx Mary txSimpleEx2 = - ShelleyTx - txbodySimpleEx2 - mempty {addrWits = mkWitnessesVKey (hashAnnotated txbodySimpleEx2) [asWitness Cast.alicePay]} - SNothing + mkBasicTx txbodySimpleEx2 + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw) + where + atw = mkWitnessesVKey (hashAnnotated txbodySimpleEx2) [asWitness Cast.alicePay] expectedUTxOSimpleEx2 :: UTxO Mary expectedUTxOSimpleEx2 = @@ -294,13 +292,11 @@ txbodyTimeEx1Valid = txbodyTimeEx1 (SJust startInterval) (SJust stopInterval) txTimeEx1 :: TxBody Mary -> ShelleyTx Mary txTimeEx1 txbody = - ShelleyTx - txbody - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txbody) [asWitness Cast.alicePay] - , scriptWits = Map.fromList [(policyID boundedTimePolicyId, boundedTimePolicy)] - } - SNothing + mkBasicTx txbody + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbody) [asWitness Cast.alicePay] + stw = Map.fromList [(policyID boundedTimePolicyId, boundedTimePolicy)] txTimeEx1Valid :: ShelleyTx Mary txTimeEx1Valid = txTimeEx1 txbodyTimeEx1Valid @@ -413,14 +409,11 @@ txbodySingWitEx1 = txSingWitEx1Valid :: ShelleyTx Mary txSingWitEx1Valid = - ShelleyTx - txbodySingWitEx1 - mempty - { addrWits = - mkWitnessesVKey (hashAnnotated txbodySingWitEx1) [asWitness Cast.bobPay, asWitness Cast.alicePay] - , scriptWits = Map.fromList [(policyID alicePolicyId, alicePolicy)] - } - SNothing + mkBasicTx txbodySingWitEx1 + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbodySingWitEx1) [asWitness Cast.bobPay, asWitness Cast.alicePay] + stw = Map.fromList [(policyID alicePolicyId, alicePolicy)] expectedUTxOSingWitEx1 :: UTxO Mary expectedUTxOSingWitEx1 = @@ -432,13 +425,13 @@ expectedUTxOSingWitEx1 = txSingWitEx1Invalid :: ShelleyTx Mary txSingWitEx1Invalid = - ShelleyTx - txbodySingWitEx1 - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txbodySingWitEx1) [asWitness Cast.bobPay] - , scriptWits = Map.fromList [(policyID alicePolicyId, alicePolicy)] - } - SNothing + mkBasicTx txbodySingWitEx1 + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbodySingWitEx1) [asWitness Cast.bobPay] + stw = Map.fromList [(policyID alicePolicyId, alicePolicy)] + + ------------------------ -- Mint Negative Values @@ -472,13 +465,12 @@ txbodyNegEx1 = txNegEx1 :: ShelleyTx Mary txNegEx1 = - ShelleyTx - txbodyNegEx1 - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txbodyNegEx1) [asWitness Cast.alicePay] - , scriptWits = Map.fromList [(policyID purplePolicyId, purplePolicy)] - } - SNothing + mkBasicTx txbodyNegEx1 + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbodyNegEx1) [asWitness Cast.alicePay] + stw = Map.fromList [(policyID purplePolicyId, purplePolicy)] + initialUTxONegEx1 :: UTxO Mary initialUTxONegEx1 = expectedUTxOSimpleEx2 @@ -562,13 +554,11 @@ txbodyWithBigValue = txBigValue :: ShelleyTx Mary txBigValue = - ShelleyTx - txbodyWithBigValue - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txbodyWithBigValue) [asWitness Cast.alicePay] - , scriptWits = Map.fromList [(policyID purplePolicyId, purplePolicy)] - } - SNothing + mkBasicTx txbodyWithBigValue + & witsTxL .~ (mkBasicTxWits & addrTxWitsL .~ atw & scriptTxWitsL .~ stw) + where + atw = mkWitnessesVKey (hashAnnotated txbodyWithBigValue) [asWitness Cast.alicePay] + stw = Map.fromList [(policyID purplePolicyId, purplePolicy)] -- -- Multi-Assets Test Group diff --git a/eras/shelley/impl/cardano-ledger-shelley.cabal b/eras/shelley/impl/cardano-ledger-shelley.cabal index 61527eeace1..381233b4424 100644 --- a/eras/shelley/impl/cardano-ledger-shelley.cabal +++ b/eras/shelley/impl/cardano-ledger-shelley.cabal @@ -97,7 +97,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson >=2, bytestring, cardano-crypto-class, diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/ByronTranslation.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/ByronTranslation.hs index 48eb6687a64..49f7c989e44 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/ByronTranslation.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/ByronTranslation.hs @@ -2,6 +2,7 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} module Cardano.Ledger.Shelley.API.ByronTranslation ( @@ -29,6 +30,7 @@ import Cardano.Ledger.Shelley.API.Types import Cardano.Ledger.Shelley.Core import Cardano.Ledger.Shelley.Rules () import Cardano.Ledger.Shelley.Translation (FromByronTranslationContext (..)) +import qualified Cardano.Ledger.UMap as UM import Cardano.Ledger.UTxO (coinBalance) import Cardano.Ledger.Val ((<->)) import qualified Data.ByteString.Short as SBS @@ -163,8 +165,18 @@ translateToShelleyLedgerState transCtxt epochNo cvs = } , lsCertState = CertState - { certDState = def {dsGenDelegs = genDelegs} + { certDState = dState , certPState = def , certVState = def } } + + dState :: DState (ShelleyEra c) + dState = + DState + { dsUnified = UM.empty + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = genDelegs + , dsIRewards = def + } + diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Genesis.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Genesis.hs index ec7e34b6c8b..388e9b2fa16 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Genesis.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Genesis.hs @@ -4,6 +4,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Shelley.API.Genesis where @@ -15,7 +16,7 @@ import Cardano.Ledger.Shelley.API.Types ( AccountState (AccountState), CertState (CertState), Coin (Coin), - DState (dsGenDelegs), + DState (..), EpochState (EpochState), GenDelegs (GenDelegs), LedgerState (LedgerState), @@ -32,6 +33,7 @@ import Cardano.Ledger.Shelley.LedgerState ( smartUTxOState, ) import Cardano.Ledger.UTxO (coinBalance) +import qualified Cardano.Ledger.UMap as UM import Cardano.Ledger.Val (Val ((<->))) import Data.Default.Class (Default, def) import Data.Kind (Type) @@ -73,6 +75,7 @@ instance -- | Helper function for constructing the initial state for any era initialStateFromGenesis :: + forall era . CanStartFromGenesis era => -- | Genesis type ShelleyGenesis (EraCrypto era) -> @@ -88,7 +91,7 @@ initialStateFromGenesis sg ag = emptySnapShots ( LedgerState (smartUTxOState (fromShelleyPParams ag pp) initialUtxo (Coin 0) (Coin 0) def) - (CertState def def (def {dsGenDelegs = GenDelegs genDelegs})) + (CertState def def dState) ) (fromShelleyPParams ag pp) (fromShelleyPParams ag pp) @@ -103,3 +106,12 @@ initialStateFromGenesis sg ag = reserves = word64ToCoin (sgMaxLovelaceSupply sg) <-> coinBalance initialUtxo genDelegs = sgGenDelegs sg pp = sgProtocolParams sg + + dState :: DState era + dState = + DState + { dsUnified = UM.empty + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = GenDelegs genDelegs + , dsIRewards = def + } diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs index 5cccbfba201..360cce7da57 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Mempool.hs @@ -8,7 +8,9 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} -- | Interface to the Shelley ledger for the purposes of managing a Shelley -- mempool. @@ -55,7 +57,8 @@ import qualified Cardano.Ledger.Shelley.Rules.Ledger as Ledger import Cardano.Ledger.Slot (SlotNo) import Control.Arrow (ArrowChoice (right), left) import Control.DeepSeq (NFData) -import Control.Monad.Except (Except, MonadError, foldM, liftEither) +import Control.Monad (foldM) +import Control.Monad.Except (Except, MonadError, liftEither) import Control.Monad.Trans.Reader (runReader) import Control.State.Transition.Extended ( BaseM, diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Validation.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Validation.hs index 4cd7c225f31..40f2bbc0661 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Validation.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Validation.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- | Interface to the block validation and chain extension logic in the Shelley diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs index 22bdebe923b..14f8f2756dc 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/API/Wallet.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- FIXME: use better names for record names {-# OPTIONS_GHC -Wno-name-shadowing #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/BlockChain.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/BlockChain.hs index 1b747761045..2a3b6f3c218 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/BlockChain.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/BlockChain.hs @@ -12,6 +12,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Core.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Core.hs index 99d2241edff..cd1ecc4f354 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Core.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Core.hs @@ -5,6 +5,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Shelley.Core ( ShelleyEraTxBody (..), diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Governance.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Governance.hs index 8ae2a4a5dce..28c967f9a9b 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Governance.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Governance.hs @@ -7,6 +7,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Shelley.Governance ( EraGovernance (..), diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/NewEpochState.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/NewEpochState.hs index f78374c66e1..b61276d85fc 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/NewEpochState.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/NewEpochState.hs @@ -38,6 +38,7 @@ import Cardano.Ledger.Shelley.LedgerState.RefundsAndDeposits (keyTxRefunds, tota import Cardano.Ledger.Shelley.LedgerState.Types import Cardano.Ledger.Shelley.TxBody (MIRPot (..)) import Cardano.Ledger.UMap (RDPair (..), UMElem (..), UMap (..)) +import qualified Cardano.Ledger.UMap as UM import Cardano.Ledger.UTxO (UTxO (..), coinBalance) import Cardano.Ledger.Val ((<+>), (<->)) import Data.Default.Class (def) @@ -87,7 +88,14 @@ genesisState genDelegs0 utxo0 = ) (CertState def def dState) where - dState = def {dsGenDelegs = GenDelegs genDelegs0} + dState :: DState era + dState = + DState + { dsUnified = UM.empty + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = GenDelegs genDelegs0 :: GenDelegs (EraCrypto era) + , dsIRewards = def + } -- Functions for stake delegation model diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/PParams.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/PParams.hs index 01233655e41..7d02b2f7025 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/PParams.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/PParams.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/RewardUpdate.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/RewardUpdate.hs index 53c0360fb91..73948577542 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/RewardUpdate.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/RewardUpdate.hs @@ -13,6 +13,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE ViewPatterns #-} -- | How to compute the reward update compuation. Also, how to spread the diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs index 6b1cffa23b6..b0db3477f0d 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs index e77926e0198..e9ad5a69189 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delegs.hs @@ -12,6 +12,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delpl.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delpl.hs index e16625ddb1f..ff84be68ec7 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delpl.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Delpl.hs @@ -10,6 +10,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Epoch.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Epoch.hs index eb738e590c5..d1cf1fa0d98 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Epoch.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Epoch.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs index 4853b04a9db..b0764f72bc8 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledger.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledgers.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledgers.hs index ae69cdfc7a2..f209b6ab470 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledgers.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Ledgers.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/NewEpoch.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/NewEpoch.hs index 547fb6b0dd1..a89dad43ab6 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/NewEpoch.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/NewEpoch.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Newpp.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Newpp.hs index e64eb0a055c..768154f1b32 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Newpp.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Newpp.hs @@ -4,6 +4,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Tick.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Tick.hs index fe7fe0ce6aa..eb2fa4fd61b 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Tick.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Tick.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Upec.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Upec.hs index 72f76b0ba27..1cb2414bbc8 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Upec.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Upec.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs index 81b2ebe40e7..fa332e50cd3 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs @@ -12,6 +12,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs index 3a1f35ae875..8804c32d41c 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxow.hs @@ -13,6 +13,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Tx.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Tx.hs index 38fbf64b9a3..9812c914782 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/Tx.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/Tx.hs @@ -14,6 +14,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxAuxData.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxAuxData.hs index ccc4da19160..176dacf186b 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxAuxData.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxAuxData.hs @@ -11,7 +11,9 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Shelley.TxAuxData ( diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxBody.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxBody.hs index a524c39279e..932bf044fac 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxBody.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxBody.hs @@ -11,6 +11,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs index 0c117f071c2..2648b9301a3 100644 --- a/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs +++ b/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxCert.hs @@ -12,7 +12,9 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# LANGUAGE ViewPatterns #-} -- Due to Delegation usage. -- TODO: remove when Delegation is gone diff --git a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs index 68694fc7cca..17cdd882eb9 100644 --- a/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs +++ b/eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Arbitrary.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- Due to Delegation usage {-# OPTIONS_GHC -Wno-orphans -Wno-deprecations #-} diff --git a/eras/shelley/test-suite/bench/BenchValidation.hs b/eras/shelley/test-suite/bench/BenchValidation.hs index 3ba4b3af03d..a5fc7c752dc 100644 --- a/eras/shelley/test-suite/bench/BenchValidation.hs +++ b/eras/shelley/test-suite/bench/BenchValidation.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-unused-binds #-} diff --git a/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Gen.hs b/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Gen.hs index 277d3b8fde4..a0f7838fae1 100644 --- a/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Gen.hs +++ b/eras/shelley/test-suite/bench/Cardano/Ledger/Shelley/Bench/Gen.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | Benchmarks for Shelley test generators. module Cardano.Ledger.Shelley.Bench.Gen ( diff --git a/eras/shelley/test-suite/cardano-ledger-shelley-test.cabal b/eras/shelley/test-suite/cardano-ledger-shelley-test.cabal index 62c642bf195..5f0e3fc6956 100644 --- a/eras/shelley/test-suite/cardano-ledger-shelley-test.cabal +++ b/eras/shelley/test-suite/cardano-ledger-shelley-test.cabal @@ -73,7 +73,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, QuickCheck >=2.13.2, base16-bytestring >=1, bytestring, diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/ConcreteCryptoTypes.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/ConcreteCryptoTypes.hs index 28306ec142e..c172fb92578 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/ConcreteCryptoTypes.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/ConcreteCryptoTypes.hs @@ -2,6 +2,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.ConcreteCryptoTypes ( diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Consensus.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Consensus.hs index d2b288196cf..088752b22eb 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Consensus.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Examples/Consensus.hs @@ -7,6 +7,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.Examples.Consensus where diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Core.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Core.hs index 543a296e378..f49d396c2d5 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Core.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Core.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.Generator.Core ( diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/EraGen.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/EraGen.hs index 72e8701c3ac..261b6053cc8 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/EraGen.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/EraGen.hs @@ -9,7 +9,9 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Infrastructure for generating STS Traces over any Era diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ScriptClass.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ScriptClass.hs index c826377555a..ae50b86fe7f 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ScriptClass.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ScriptClass.hs @@ -11,6 +11,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Test.Cardano.Ledger.Shelley.Generator.ScriptClass ( ScriptClass (..), diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ShelleyEraGen.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ShelleyEraGen.hs index f5ea17ba0c0..8c047b5f453 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ShelleyEraGen.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/ShelleyEraGen.hs @@ -4,6 +4,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Chain.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Chain.hs index 6d5226e4d58..e75c8753858 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Chain.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Chain.hs @@ -9,6 +9,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- Allow for an orphan HasTrace instance for CHAIN, since HasTrace only pertains to tests {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Ledger.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Ledger.hs index 04e33e3ed98..509bae40864 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Ledger.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/Ledger.hs @@ -8,6 +8,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- The HasTrace instance relies on test generators and so cannot -- be included with the LEDGER STS diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/TxCert.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/TxCert.hs index 58ccff57abd..0b4705f6254 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/TxCert.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Trace/TxCert.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.Generator.Trace.TxCert ( diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Utxo.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Utxo.hs index 0aa22d0d8ca..f812a54e5a4 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Utxo.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Generator/Utxo.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.Generator.Utxo ( diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/LaxBlock.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/LaxBlock.hs index 43daff88d18..db07bfb0340 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/LaxBlock.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/LaxBlock.hs @@ -6,6 +6,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Shelley.LaxBlock where diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/PropertyTests.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/PropertyTests.hs index 9442b54a89d..d0b7eace9ee 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/PropertyTests.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/PropertyTests.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.PropertyTests ( commonTests, diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs index c137dfad23d..a502fd172df 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rewards.hs @@ -8,6 +8,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Currently this uses the trace mechanism to check that computing rewards has diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/AdaPreservation.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/AdaPreservation.hs index 9c20fb97d19..b940b1a70c6 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/AdaPreservation.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/AdaPreservation.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.Rules.AdaPreservation ( adaPreservationProps, diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/Chain.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/Chain.hs index 6157b2a6fb4..da29535f327 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/Chain.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/Chain.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -84,6 +85,7 @@ import Cardano.Ledger.Shelley.Rules ( ) import Cardano.Ledger.Slot (EpochNo) import Cardano.Ledger.TreeDiff (ToExpr (toExpr), defaultExprViaShow) +import qualified Cardano.Ledger.UMap as UM import Cardano.Ledger.UTxO (UTxO (..)) import Cardano.Protocol.TPraos.BHeader ( BHeader, @@ -188,7 +190,7 @@ instance NoThunks (TestChainPredicateFailure era) -- | Creates a valid initial chain state -initialShelleyState :: +initialShelleyState :: forall era . ( EraTxOut era , EraGovernance era , Default (StashedAVVMAddresses era) @@ -218,7 +220,7 @@ initialShelleyState lab e utxo reserves genDelegs pp initNonce = (Coin 0) emptyGovernanceState ) - (CertState def def (def {dsGenDelegs = GenDelegs genDelegs})) + (CertState def def dState) ) pp pp @@ -242,6 +244,15 @@ initialShelleyState lab e utxo reserves genDelegs pp initNonce = (Map.elems genDelegs) ) + dState :: DState era + dState = + DState + { dsUnified = UM.empty + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = GenDelegs genDelegs + , dsIRewards = def + } + instance ( EraPParams era , Embed (EraRule "BBODY" era) (CHAIN era) diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/ClassifyTraces.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/ClassifyTraces.hs index 89cf29260fa..08600f7a913 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/ClassifyTraces.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/ClassifyTraces.hs @@ -7,6 +7,7 @@ {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.Rules.ClassifyTraces ( onlyValidLedgerSignalsAreGenerated, diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs index e46af08133e..b8eaf8b2ddc 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Rules/TestChain.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.Rules.TestChain ( delegTraceFromBlock, diff --git a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Utils.hs b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Utils.hs index 9717c5b4863..ae74901b1dc 100644 --- a/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Utils.hs +++ b/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/Utils.hs @@ -8,6 +8,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs index eb178c55af3..3a2ed0917ca 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/Combinators.hs @@ -4,6 +4,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | -- Module : Test.Cardano.Ledger.Shelley.Examples.Combinators diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/MirTransfer.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/MirTransfer.hs index c5a24c42816..3189d584031 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/MirTransfer.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Examples/MirTransfer.hs @@ -9,6 +9,7 @@ where import Cardano.Ledger.BaseTypes (ProtVer (..), natVersion) import Cardano.Ledger.Coin (Coin (..), DeltaCoin (..)) import Cardano.Ledger.Keys ( + GenDelegs (..), KeyRole (..), hashKey, ) @@ -28,9 +29,9 @@ import Cardano.Ledger.Shelley.API ( import Cardano.Ledger.Shelley.Core import Cardano.Ledger.Shelley.Rules (ShelleyDelegPredFailure (..)) import Cardano.Ledger.Slot (SlotNo (..)) +import qualified Cardano.Ledger.UMap as UM import Control.State.Transition.Extended hiding (Assertion) import Control.State.Transition.Trace (checkTrace, (.-), (.->>)) -import Data.Default.Class (def) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Lens.Micro @@ -71,14 +72,23 @@ testMirTransfer :: Assertion testMirTransfer pv pot target ir acnt (Right expected) = do checkTrace @(ShelleyDELEG ShelleyTest) runShelleyBase (env pv acnt) $ - (pure (def {dsIRewards = ir})) .- (TxCertMir (MIRCert pot target)) .->> (def {dsIRewards = expected}) + (pure (dStateWithRewards ir)) .- (TxCertMir (MIRCert pot target)) .->> (dStateWithRewards expected) testMirTransfer pv pot target ir acnt predicateFailure@(Left _) = do let st = runShelleyBase $ applySTSTest @(ShelleyDELEG ShelleyTest) - (TRC (env pv acnt, def {dsIRewards = ir}, TxCertMir (MIRCert pot target))) + (TRC (env pv acnt, dStateWithRewards ir, TxCertMir (MIRCert pot target))) (ignoreAllButIRWD st) @?= predicateFailure +dStateWithRewards :: InstantaneousRewards c -> DState (ShelleyEra c) +dStateWithRewards ir = + DState + { dsUnified = UM.empty + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = GenDelegs Map.empty + , dsIRewards = ir + } + alice :: Credential 'Staking C_Crypto alice = (KeyHashObj . hashKey . snd) $ mkKeyPair (RawSeed 0 0 0 0 1) diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs index 7d9c41d90b3..3692d53205b 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Fees.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.Fees ( sizeTests, @@ -55,7 +56,6 @@ import Cardano.Ledger.Shelley.TxBody ( import Cardano.Ledger.Shelley.TxCert (pattern ShelleyTxCertDeleg) import Cardano.Ledger.Shelley.TxWits ( addrWits, - scriptWits, ) import Cardano.Ledger.Slot (EpochNo (..), SlotNo (..)) import Cardano.Ledger.TxIn (mkTxInPartial) @@ -442,6 +442,10 @@ txWithMultiSig = ShelleyTx { body = txbWithMultiSig , wits = + mkBasicTxWits + & addrTxWitsL .~ mkWitnessesVKey (hashAnnotated txbWithMultiSig) [alicePay, bobPay] + & scriptTxWitsL .~ Map.singleton (hashScript @Shelley msig) msig +{- mempty { addrWits = mkWitnessesVKey @@ -449,6 +453,7 @@ txWithMultiSig = [alicePay, bobPay] , scriptWits = Map.singleton (hashScript @Shelley msig) msig } +-} , auxiliaryData = SNothing } diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/MultiSigExamples.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/MultiSigExamples.hs index a9cdb553d08..de2ab1b3c21 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/MultiSigExamples.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/MultiSigExamples.hs @@ -59,7 +59,7 @@ import Cardano.Ledger.Shelley.Scripts ( import Cardano.Ledger.Shelley.Tx (ShelleyTx (..), TxId) import Cardano.Ledger.Shelley.TxAuxData (ShelleyTxAuxData) import Cardano.Ledger.Shelley.TxBody (ShelleyTxBody (..)) -import Cardano.Ledger.Shelley.TxWits (addrWits, scriptWits) +import Cardano.Ledger.Shelley.TxWits (ShelleyTxWits (..)) import Cardano.Ledger.Slot (SlotNo (..)) import Cardano.Ledger.TxIn (TxIn (..)) import qualified Cardano.Ledger.Val as Val @@ -179,11 +179,10 @@ makeTx :: ShelleyTx (ShelleyEra c) makeTx txBody keyPairs msigs = ShelleyTx txBody txWits . maybeToStrictMaybe where - txWits = - mempty - { addrWits = mkWitnessesVKey (hashAnnotated txBody) keyPairs - , scriptWits = msigs - } + txWits :: ShelleyTxWits (ShelleyEra c) + txWits = mkBasicTxWits + & addrTxWitsL .~ (mkWitnessesVKey (hashAnnotated txBody) keyPairs) + & scriptTxWitsL .~ msigs aliceInitCoin :: Coin aliceInitCoin = Coin 10000 diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs index 324a993538e..df5faffa2aa 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/Serialisation/Golden/Encoding.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -8,6 +9,7 @@ {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Golden tests that check CBOR token encoding. @@ -116,7 +118,7 @@ import Cardano.Ledger.Shelley.TxCert ( pattern TxCertGenesisDeleg, pattern TxCertMir, ) -import Cardano.Ledger.Shelley.TxWits (ShelleyTxWits, addrWits, scriptWits) +import Cardano.Ledger.Shelley.TxWits (ShelleyTxWits, addrWits) import Cardano.Ledger.Slot (BlockNo (..), EpochNo (..), SlotNo (..)) import Cardano.Ledger.TxIn (TxId, TxIn (..)) import Cardano.Protocol.TPraos.BHeader ( @@ -159,6 +161,7 @@ import Data.Ratio ((%)) import qualified Data.Sequence.Strict as StrictSeq import qualified Data.Set as Set import Data.String (fromString) +import Data.Word (Word64) import Lens.Micro ((&), (.~)) import Numeric.Natural (Natural) import Test.Cardano.Ledger.Binary.TreeDiff (CBORBytes (CBORBytes), diffExpr) @@ -908,7 +911,7 @@ tests = w = mkWitnessVKey @C_Crypto txbh testKey1 s = Map.singleton (hashScript @C testScript) (testScript @C_Crypto) txwits :: ShelleyTxWits C - txwits = mempty {addrWits = Set.singleton w, scriptWits = s} + txwits = mkBasicTxWits @C & addrTxWitsL .~ Set.singleton w & scriptTxWitsL .~ s md = (TxAuxData.ShelleyTxAuxData @C) $ Map.singleton 17 (TxAuxData.I 42) in checkEncodingCBORAnnotated shelleyProtVer @@ -1035,6 +1038,7 @@ tests = sig = signedKES () 0 (testBHB @C) (kesSignKey $ testKESKeys @C_Crypto) bh = BHeader (testBHB @C) sig tout = StrictSeq.singleton $ ShelleyTxOut @C testAddrE (Coin 2) + txb :: Word64 -> ShelleyTxBody C txb s = ShelleyTxBody @C (Set.fromList [genesisTxIn1]) @@ -1045,6 +1049,7 @@ tests = (SlotNo s) SNothing SNothing + txb1, txb2, txb3, txb4, txb5 :: ShelleyTxBody C txb1 = txb 500 txb2 = txb 501 txb3 = txb 502 @@ -1053,24 +1058,27 @@ tests = w1 = mkWitnessVKey (hashAnnotated txb1) testKey1 w2 = mkWitnessVKey (hashAnnotated txb1) testKey2 ws = Set.fromList [w1, w2] - tx1 = ShelleyTx @C txb1 mempty {addrWits = Set.singleton w1} SNothing - tx2 = ShelleyTx @C txb2 mempty {addrWits = ws} SNothing + tx1, tx2, tx3, tx4, tx5 :: ShelleyTx C + tx1 = mkBasicTx txb1 + & witsTxL @C .~ (mkBasicTxWits @C & addrTxWitsL .~ Set.singleton w1) + tx2 = mkBasicTx txb2 + & witsTxL @C .~ (mkBasicTxWits @C & addrTxWitsL .~ ws) tx3 = - ShelleyTx @C - txb3 - mempty - { scriptWits = - Map.singleton (hashScript @C testScript) testScript - } - SNothing + mkBasicTx txb3 + & witsTxL @C .~ + (mkBasicTxWits @C & scriptTxWitsL .~ + Map.singleton (hashScript @C testScript) testScript) ss = Map.fromList [ (hashScript @C testScript, testScript) , (hashScript @C testScript2, testScript2) ] - tx4 = ShelleyTx txb4 mempty {scriptWits = ss} SNothing + tx4 = mkBasicTx txb4 + & witsTxL @C .~ (mkBasicTxWits @C & scriptTxWitsL .~ ss) tx5MD = TxAuxData.ShelleyTxAuxData @C $ Map.singleton 17 (TxAuxData.I 42) - tx5 = ShelleyTx txb5 mempty {addrWits = ws, scriptWits = ss} (SJust tx5MD) + tx5 = mkBasicTx txb5 + & witsTxL @C .~ (mkBasicTxWits @C & addrTxWitsL .~ ws & scriptTxWitsL .~ ss) + & auxDataTxL @C .~ SJust tx5MD txns = ShelleyTxSeq $ StrictSeq.fromList [tx1, tx2, tx3, tx4, tx5] in checkEncodingCBORAnnotated shelleyProtVer @@ -1128,19 +1136,20 @@ tests = expected = either error id $ B16.decode expectedHex actualHex = B16.encode actual expectedHex = - "8700a1581ce0a714319812c3f773ba04ec5d6b3ffcd5aad85006805b047b0825\ - \410aa1581ca646474b8f5431261506b6c273d307c7569a4eb6c96b42dd4a2952\ - \0a0386821927101903e882838280a084a0a0a0a08482a0a0a0a084a0a0000085\ - \a1825820ee155ace9c40292074cb6aff8c9ccdd273c81648ff1149ef36bcea6e\ - \bb8a3e250082583900cb9358529df4729c3246a2a033cb9821abbfd16de48880\ - \05904abc410d6a577e9441ad8ed9663931906e4d43ece8f82c712b1d0235affb\ - \060a1903e80182a0a082a0a08483a0a0a083a0a0a083a0a0a000920000001908\ - \00000000001864d81e820001d81e820001d81e820001d81e8200018100020000\ - \0092000000190800000000001864d81e820001d81e820001d81e820001d81e82\ - \000181000200010082a000818300880082020082a000000000a0a0840185a080\ - \3903ba820200a0a082a0a0a1581ce0a714319812c3f773ba04ec5d6b3ffcd5aa\ - \d85006805b047b082541828201015820c5e21ab1c9f6022d81c3b25e3436cb7f\ - \1df77f9652ae3e1310c28e621dd87b4ca0" + mconcat + [ "8700a1581ce0a714319812c3f773ba04ec5d6b3ffcd5aad85006805b047b0825" + , "410aa1581ca646474b8f5431261506b6c273d307c7569a4eb6c96b42dd4a2952" + , "0a0386821927101903e882838280a084a0a0a0a08482a0a0a0a084a0a0000085" + , "a1825820ee155ace9c40292074cb6aff8c9ccdd273c81648ff1149ef36bcea6e" + , "bb8a3e250082583900cb9358529df4729c3246a2a033cb9821abbfd16de48880" + , "05904abc410d6a577e9441ad8ed9663931906e4d43ece8f82c712b1d0235affb" + , "060a1903e80182a0a082a0a08483a0a0a083a0a0a083a0a0a000920000001908" + , "00000000001864d81e820001d81e820001d81e820001d81e8200018100020000" + , "0092000000190800000000001864d81e820001d81e820001d81e820001d81e82" + , "000181000200010082a000818300880082020082a000000000a0a0840185a080" + , "3903ba820200a0a082a0a0a1581ce0a714319812c3f773ba04ec5d6b3ffcd5aa" + , "d85006805b047b082541828201015820c5e21ab1c9f6022d81c3b25e3436cb7f" + , "1df77f9652ae3e1310c28e621dd87b4ca0" ] in testCase "ledger state golden test" $ unless (actual == expected) $ assertFailure $ diff --git a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs index 9ec734e7985..4f174aed7c3 100644 --- a/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs +++ b/eras/shelley/test-suite/test/Test/Cardano/Ledger/Shelley/UnitTests.hs @@ -8,6 +8,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Shelley.UnitTests (unitTests) where diff --git a/libs/cardano-data/cardano-data.cabal b/libs/cardano-data/cardano-data.cabal index d681e7af013..3907e24ad21 100644 --- a/libs/cardano-data/cardano-data.cabal +++ b/libs/cardano-data/cardano-data.cabal @@ -30,7 +30,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, cardano-ledger-binary >=1.0, containers, diff --git a/libs/cardano-data/src/Data/Universe.hs b/libs/cardano-data/src/Data/Universe.hs index 0b9cce5e974..b5b2dceac20 100644 --- a/libs/cardano-data/src/Data/Universe.hs +++ b/libs/cardano-data/src/Data/Universe.hs @@ -1,5 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} @@ -44,7 +45,12 @@ where import Data.Kind (Type) import Data.Type.Equality (TestEquality (..), (:~:) (Refl)) -import Type.Reflection (TypeRep, pattern App, pattern Con, pattern Fun) +#if __GLASGOW_HASKELL__ < 906 +import Type.Reflection (TypeRep, pattern App, pattern Con, pattern Fun +#else +-- Ghc-9.6 removed the Fun constructor. +import Type.Reflection (TypeRep, pattern App, pattern Con) +#endif -- ================================================== @@ -176,12 +182,15 @@ compareTypeRep (App x a) (App y b) = case compareTypeRep x y of EQ -> compareTypeRep a b other -> other +#if __GLASGOW_HASKELL__ < 906 +-- Ghc-9.6 removed the Fun constructor making these redundant. compareTypeRep (App _ _) _ = LT compareTypeRep _ (App _ _) = GT compareTypeRep (Fun x a) (Fun y b) = case compareTypeRep x y of EQ -> compareTypeRep a b other -> other +#endif instance Singleton TypeRep where testEql = testEquality diff --git a/libs/cardano-ledger-api/cardano-ledger-api.cabal b/libs/cardano-ledger-api/cardano-ledger-api.cabal index ec293737ad2..bc2546adff0 100644 --- a/libs/cardano-ledger-api/cardano-ledger-api.cabal +++ b/libs/cardano-ledger-api/cardano-ledger-api.cabal @@ -45,7 +45,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, array, bytestring, cardano-ledger-allegra >=1.1, diff --git a/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Scripts/ExUnits.hs b/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Scripts/ExUnits.hs index dbb956c62c1..360f30fb86b 100644 --- a/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Scripts/ExUnits.hs +++ b/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Scripts/ExUnits.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Cardano.Ledger.Api.Scripts.ExUnits ( diff --git a/libs/cardano-ledger-binary/cardano-ledger-binary.cabal b/libs/cardano-ledger-binary/cardano-ledger-binary.cabal index df45891aa40..a01b2c59049 100644 --- a/libs/cardano-ledger-binary/cardano-ledger-binary.cabal +++ b/libs/cardano-ledger-binary/cardano-ledger-binary.cabal @@ -46,12 +46,12 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, base16-bytestring, binary, bytestring, - cardano-binary >=1.6, + cardano-binary >=1.7, cardano-crypto-class >=2.1, cardano-crypto-praos >=2.1, cardano-slotting, @@ -67,7 +67,7 @@ library network, nothunks, primitive, - plutus-ledger-api ^>=1.6, + plutus-ledger-api ^>=1.7, recursion-schemes, serialise, tagged, diff --git a/libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs b/libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs index c5ccf114803..13c9e993a87 100644 --- a/libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs +++ b/libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -64,7 +65,9 @@ import Cardano.Ledger.Binary.Decoding.DecCBOR (DecCBOR (decCBOR)) import Cardano.Ledger.Binary.Decoding.Decoder import Cardano.Ledger.Binary.Encoding.EncCBOR (EncCBOR (encCBOR)) import Cardano.Ledger.Binary.Version (Version) +#if ! MIN_VERSION_base(4,18,0) import Control.Applicative (liftA2) +#endif import qualified Data.Map.Strict as Map import Data.Maybe.Strict (StrictMaybe (..)) import Data.Set (Set, insert, member) diff --git a/libs/cardano-ledger-binary/testlib/Test/Cardano/Ledger/Binary/Arbitrary.hs b/libs/cardano-ledger-binary/testlib/Test/Cardano/Ledger/Binary/Arbitrary.hs index 4373c281834..2f55b43569f 100644 --- a/libs/cardano-ledger-binary/testlib/Test/Cardano/Ledger/Binary/Arbitrary.hs +++ b/libs/cardano-ledger-binary/testlib/Test/Cardano/Ledger/Binary/Arbitrary.hs @@ -6,6 +6,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} module Test.Cardano.Ledger.Binary.Arbitrary ( diff --git a/libs/cardano-ledger-core/cardano-ledger-core.cabal b/libs/cardano-ledger-core/cardano-ledger-core.cabal index 639c60694a8..0af630613c3 100644 --- a/libs/cardano-ledger-core/cardano-ledger-core.cabal +++ b/libs/cardano-ledger-core/cardano-ledger-core.cabal @@ -75,7 +75,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson >=2, base16-bytestring, binary, diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs index 24b82b48a07..1d3f02a5012 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Core.hs @@ -11,6 +11,7 @@ {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-orphans -Wno-redundant-constraints #-} -- | This module defines core type families which we know to vary from era to diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Era.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Era.hs index 547c204f989..72e70ddee8f 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Era.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Era.hs @@ -7,6 +7,7 @@ {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} module Cardano.Ledger.Core.Era ( diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/PParams.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/PParams.hs index d88181cb8ac..dca0e36c3cd 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/PParams.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/PParams.hs @@ -15,6 +15,7 @@ {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Core.PParams ( EraPParams (..), diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Translation.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Translation.hs index 7b14feddaea..5fbd8dac0f4 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Translation.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/Translation.hs @@ -4,6 +4,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.Core.Translation ( PreviousEra, diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/TxCert.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/TxCert.hs index 3ebb73ffc3f..73af89e326f 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Core/TxCert.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Core/TxCert.hs @@ -6,6 +6,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# LANGUAGE ViewPatterns #-} module Cardano.Ledger.Core.TxCert ( diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Crypto.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Crypto.hs index b1d0233b5b2..53887b9f6ea 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Crypto.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Crypto.hs @@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | Package all the crypto constraints into one place. module Cardano.Ledger.Crypto where diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Keys/Bootstrap.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Keys/Bootstrap.hs index e91652b5e30..958f9fc3dd3 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Keys/Bootstrap.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Keys/Bootstrap.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Cardano.Ledger.Keys.Bootstrap ( diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs index 6f7721940ee..bb36cd87cac 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs @@ -2,6 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | Describes modes under which we might validate certain rules in the ledger. -- diff --git a/libs/cardano-ledger-core/src/Cardano/Ledger/UTxO.hs b/libs/cardano-ledger-core/src/Cardano/Ledger/UTxO.hs index 14e00d95666..d80b3d6dfff 100644 --- a/libs/cardano-ledger-core/src/Cardano/Ledger/UTxO.hs +++ b/libs/cardano-ledger-core/src/Cardano/Ledger/UTxO.hs @@ -12,7 +12,9 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Ledger.UTxO ( -- * Primitives diff --git a/libs/cardano-ledger-pretty/cardano-ledger-pretty.cabal b/libs/cardano-ledger-pretty/cardano-ledger-pretty.cabal index 10a2a901864..0ac0acd8daf 100644 --- a/libs/cardano-ledger-pretty/cardano-ledger-pretty.cabal +++ b/libs/cardano-ledger-pretty/cardano-ledger-pretty.cabal @@ -31,7 +31,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bech32, bytestring, cardano-crypto-class, diff --git a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty.hs b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty.hs index 997cb1824d9..38843654f45 100644 --- a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty.hs +++ b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty.hs @@ -8,6 +8,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- Due to usage of Delegation {-# OPTIONS_GHC -Wno-deprecations #-} diff --git a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Alonzo.hs b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Alonzo.hs index bb432dd4c96..95189a741d1 100644 --- a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Alonzo.hs +++ b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Alonzo.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Babbage.hs b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Babbage.hs index 37c06087b2e..534863cfc01 100644 --- a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Babbage.hs +++ b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Babbage.hs @@ -5,6 +5,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Conway.hs b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Conway.hs index 5932dfee8ef..b0180d5c0f9 100644 --- a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Conway.hs +++ b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Conway.hs @@ -7,6 +7,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} diff --git a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Mary.hs b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Mary.hs index 617a7da5229..6ed3eb02f3e 100644 --- a/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Mary.hs +++ b/libs/cardano-ledger-pretty/src/Cardano/Ledger/Pretty/Mary.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx.hs b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx.hs index 4ba751818da..b2ec2f8cf2e 100644 --- a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx.hs +++ b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Benchmarks for transaction application diff --git a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx/Gen.hs b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx/Gen.hs index 2a669c881ff..d5ae2583dad 100644 --- a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx/Gen.hs +++ b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/ApplyTx/Gen.hs @@ -4,6 +4,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} -- | Generates fixed transaction/state pairs for benchmarking. module Bench.Cardano.Ledger.ApplyTx.Gen (generateApplyTxEnvForEra, ApplyTxEnv (..)) where diff --git a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/Balance.hs b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/Balance.hs index 0b2766ab8ff..1e9df957f13 100644 --- a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/Balance.hs +++ b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/Balance.hs @@ -1,6 +1,7 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} module Bench.Cardano.Ledger.Balance (balanceBenchmarks) where diff --git a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/StakeDistr.hs b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/StakeDistr.hs index ef7c468bf30..c496cf43c6e 100644 --- a/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/StakeDistr.hs +++ b/libs/cardano-ledger-test/bench/Bench/Cardano/Ledger/StakeDistr.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | Benchmark the TickF rule. and its major sub-computations and rules, to discover where the time is spent diff --git a/libs/cardano-ledger-test/cardano-ledger-test.cabal b/libs/cardano-ledger-test/cardano-ledger-test.cabal index fe2d4a202ff..e37f5700255 100644 --- a/libs/cardano-ledger-test/cardano-ledger-test.cabal +++ b/libs/cardano-ledger-test/cardano-ledger-test.cabal @@ -70,7 +70,7 @@ library build-depends: array, - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-data, cardano-crypto-class, @@ -99,7 +99,7 @@ library nothunks, plutus-core, hspec, - plutus-ledger-api ^>=1.6, + plutus-ledger-api ^>=1.7, prettyprinter, QuickCheck, small-steps, diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Alonzo/Tools.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Alonzo/Tools.hs index 5feef8dc4f7..9039b92c2f8 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Alonzo/Tools.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Alonzo/Tools.hs @@ -4,6 +4,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Test.Cardano.Ledger.Alonzo.Tools (tests) where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs index b7b4c8b36ab..18faba362c0 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoBBODY.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Examples.AlonzoBBODY (tests) where @@ -53,6 +54,7 @@ import Cardano.Ledger.Shelley.API ( CertState (..), DState (..), LedgerState (..), + GenDelegs (..), PoolParams (..), ProtVer (..), ShelleyDelegCert (..), @@ -183,15 +185,20 @@ initialBBodyState pf utxo = dpstate = def { certDState = - def + DState { dsUnified = UM.insert (scriptStakeCredSuceed pf) (UM.RDPair (UM.CompactCoin 1000) successDeposit) (RewDepUView UM.empty) + , dsFutureGenDelegs = Map.empty + , dsGenDelegs = GenDelegs Map.empty + , dsIRewards = def } } + + testAlonzoBlock :: ( GoodCrypto (EraCrypto era) , HasTokens era diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoInvalidTxUTXOW.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoInvalidTxUTXOW.hs index 9be30ad68ac..a1758e14dce 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoInvalidTxUTXOW.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoInvalidTxUTXOW.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Examples.AlonzoInvalidTxUTXOW (tests) where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoValidTxUTXOW.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoValidTxUTXOW.hs index 52cfcf3bc5e..fafa72263ef 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoValidTxUTXOW.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/AlonzoValidTxUTXOW.hs @@ -10,6 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Examples.AlonzoValidTxUTXOW (tests) where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/BabbageFeatures.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/BabbageFeatures.hs index 70bc2f19ec3..5563bfa89e1 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/BabbageFeatures.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Examples/BabbageFeatures.hs @@ -11,6 +11,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Examples.BabbageFeatures where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs index d0ab594e854..1572a409691 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/GenState.hs @@ -9,6 +9,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | Strategy for Generic Tests -- Make the GenState include a Mode of the NewEpochState, modify diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Indexed.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Indexed.hs index 353178e3e2a..d23612325d2 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Indexed.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Indexed.hs @@ -10,6 +10,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Cardano.Ledger.Generic.Indexed where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/MockChain.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/MockChain.hs index 3e01a1dae0d..d04343d06bf 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/MockChain.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/MockChain.hs @@ -9,6 +9,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Generic.MockChain where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/ModelState.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/ModelState.hs index d22660c23e6..11becffb002 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/ModelState.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/ModelState.hs @@ -14,6 +14,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE ViewPatterns #-} -- | The data types in this file constitute a Model of the NewEpochState diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/PrettyCore.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/PrettyCore.hs index 317e33f56d9..e0a322893fb 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/PrettyCore.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/PrettyCore.hs @@ -8,7 +8,9 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {-# OPTIONS_GHC -Wno-orphans #-} module Test.Cardano.Ledger.Generic.PrettyCore where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Proof.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Proof.hs index e9ec470d7e3..e61453a062e 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Proof.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Proof.hs @@ -9,6 +9,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} -- Used for Reflect classes {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Properties.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Properties.hs index 8bb5bf1d099..ea26d14f0cc 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Properties.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Properties.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Generic.Properties where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Same.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Same.hs index f3aa7f7d36c..5809cce8d25 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Same.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Same.hs @@ -8,6 +8,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Scriptic.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Scriptic.hs index 8832e430707..2d2546e5954 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Scriptic.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/Scriptic.hs @@ -6,6 +6,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Test.Cardano.Ledger.Generic.Scriptic where diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/TxGen.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/TxGen.hs index 1c9e80b5d1b..a51541d7cc2 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/TxGen.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/Generic/TxGen.hs @@ -12,6 +12,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Ledger.Generic.TxGen ( diff --git a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/TestableEra.hs b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/TestableEra.hs index ce6b37d6b5f..f8fb0134c43 100644 --- a/libs/cardano-ledger-test/src/Test/Cardano/Ledger/TestableEra.hs +++ b/libs/cardano-ledger-test/src/Test/Cardano/Ledger/TestableEra.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE UndecidableSuperClasses #-} + -- | Defines the requirements on an era to be testable module Test.Cardano.Ledger.TestableEra where diff --git a/libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal b/libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal index c9d7f077f16..f3521c03316 100644 --- a/libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal +++ b/libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal @@ -31,7 +31,7 @@ library -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-crypto-class, cardano-ledger-allegra >=1.1, diff --git a/libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs b/libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs index 2a320b5c983..c4870c5524b 100644 --- a/libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs +++ b/libs/cardano-protocol-tpraos/src/Cardano/Protocol/TPraos/API.hs @@ -13,6 +13,7 @@ {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} diff --git a/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Arbitrary.hs b/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Arbitrary.hs index 0e6a7d20ce5..d32c740cdc3 100644 --- a/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Arbitrary.hs +++ b/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Arbitrary.hs @@ -7,6 +7,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Create.hs b/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Create.hs index d1d5cd325d0..fbe6ba19587 100644 --- a/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Create.hs +++ b/libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Create.hs @@ -7,6 +7,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Test.Cardano.Protocol.TPraos.Create ( diff --git a/libs/ledger-state/ledger-state.cabal b/libs/ledger-state/ledger-state.cabal index 810aeb50b3d..88234e9d91e 100644 --- a/libs/ledger-state/ledger-state.cabal +++ b/libs/ledger-state/ledger-state.cabal @@ -19,6 +19,7 @@ source-repository head library exposed-modules: + Cardano.Ledger.State Cardano.Ledger.State.UTxO Cardano.Ledger.State.Orphans Cardano.Ledger.State.Schema @@ -33,7 +34,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-crypto-class, cardano-ledger-alonzo, @@ -49,7 +50,7 @@ library foldl, vector, microlens, - persistent <2.14, + persistent <2.15, persistent-sqlite, prettyprinter, set-algebra, diff --git a/libs/ledger-state/src/Cardano/Ledger/State/Query.hs b/libs/ledger-state/src/Cardano/Ledger/State/Query.hs index 3d7a1a33477..101f93f7c50 100644 --- a/libs/ledger-state/src/Cardano/Ledger/State/Query.hs +++ b/libs/ledger-state/src/Cardano/Ledger/State/Query.hs @@ -5,6 +5,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Cardano.Ledger.State.Query where @@ -47,6 +48,7 @@ insertGetKey :: , PersistUniqueWrite backend , PersistRecordBackend record backend , AtLeastOneUniqueKey record + , SafeToInsert record ) => record -> ReaderT backend m (Key record) diff --git a/libs/ledger-state/src/Cardano/Ledger/State/Schema.hs b/libs/ledger-state/src/Cardano/Ledger/State/Schema.hs index 910696253ff..5d0bfcd1520 100644 --- a/libs/ledger-state/src/Cardano/Ledger/State/Schema.hs +++ b/libs/ledger-state/src/Cardano/Ledger/State/Schema.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-name-shadowing #-} diff --git a/libs/non-integral/non-integral.cabal b/libs/non-integral/non-integral.cabal index 7218c24c1cd..54771f71906 100644 --- a/libs/non-integral/non-integral.cabal +++ b/libs/non-integral/non-integral.cabal @@ -23,7 +23,7 @@ library -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages - build-depends: base >=4.14 && <4.17 + build-depends: base >=4.14 && <4.19 test-suite non-integral-test type: exitcode-stdio-1.0 diff --git a/libs/plutus-preprocessor/plutus-preprocessor.cabal b/libs/plutus-preprocessor/plutus-preprocessor.cabal index 17a6da2a6eb..456f2845a62 100644 --- a/libs/plutus-preprocessor/plutus-preprocessor.cabal +++ b/libs/plutus-preprocessor/plutus-preprocessor.cabal @@ -25,7 +25,7 @@ executable plutus-preprocessor other-modules: PlutusScripts default-language: Haskell2010 build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, bytestring, cardano-ledger-alonzo >=1.2, flat, @@ -36,7 +36,7 @@ executable plutus-preprocessor serialise, template-haskell - if impl(ghc <9.2) + if (impl(ghc <9.2) || impl(ghc >=9.3)) buildable: False executable plutus-debug @@ -44,6 +44,6 @@ executable plutus-debug hs-source-dirs: src default-language: Haskell2010 build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, cardano-ledger-alonzo, cardano-ledger-core >=1.0 diff --git a/libs/set-algebra/set-algebra.cabal b/libs/set-algebra/set-algebra.cabal index a23097c535d..ed4ba094ecb 100644 --- a/libs/set-algebra/set-algebra.cabal +++ b/libs/set-algebra/set-algebra.cabal @@ -30,8 +30,8 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, - ansi-wl-pprint, + base >=4.14 && <4.19, + ansi-wl-pprint <1, cardano-data >=1.1, containers diff --git a/libs/small-steps-test/small-steps-test.cabal b/libs/small-steps-test/small-steps-test.cabal index b600ee6dd9f..0209870b651 100644 --- a/libs/small-steps-test/small-steps-test.cabal +++ b/libs/small-steps-test/small-steps-test.cabal @@ -29,7 +29,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, deepseq, cardano-ledger-binary:{cardano-ledger-binary, testlib} >=1.0, hedgehog >=1.0.4, diff --git a/libs/small-steps-test/src/Control/State/Transition/Generator.hs b/libs/small-steps-test/src/Control/State/Transition/Generator.hs index 83cf9853013..7a5a2964ca0 100644 --- a/libs/small-steps-test/src/Control/State/Transition/Generator.hs +++ b/libs/small-steps-test/src/Control/State/Transition/Generator.hs @@ -10,7 +10,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE TypeInType #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- | Generators for transition systems. diff --git a/libs/small-steps-test/src/Control/State/Transition/Trace.hs b/libs/small-steps-test/src/Control/State/Transition/Trace.hs index 509fcc85541..c4f05e92143 100644 --- a/libs/small-steps-test/src/Control/State/Transition/Trace.hs +++ b/libs/small-steps-test/src/Control/State/Transition/Trace.hs @@ -12,6 +12,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- | Traces of transition systems and associated operators. diff --git a/libs/small-steps-test/src/Control/State/Transition/Trace/Generator/QuickCheck.hs b/libs/small-steps-test/src/Control/State/Transition/Trace/Generator/QuickCheck.hs index ef012c75440..37089c38f04 100644 --- a/libs/small-steps-test/src/Control/State/Transition/Trace/Generator/QuickCheck.hs +++ b/libs/small-steps-test/src/Control/State/Transition/Trace/Generator/QuickCheck.hs @@ -12,6 +12,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} module Control.State.Transition.Trace.Generator.QuickCheck ( diff --git a/libs/small-steps/small-steps.cabal b/libs/small-steps/small-steps.cabal index aaff0a398f1..bdc04a82c0d 100644 --- a/libs/small-steps/small-steps.cabal +++ b/libs/small-steps/small-steps.cabal @@ -35,7 +35,7 @@ library build-depends: aeson, - base >=4.14 && <4.17, + base >=4.14 && <4.19, containers, data-default-class, free, diff --git a/libs/small-steps/src/Control/State/Transition/Extended.hs b/libs/small-steps/src/Control/State/Transition/Extended.hs index 37a38dcb804..14e7cc54c41 100644 --- a/libs/small-steps/src/Control/State/Transition/Extended.hs +++ b/libs/small-steps/src/Control/State/Transition/Extended.hs @@ -18,6 +18,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -- | Small step state transition systems. diff --git a/libs/small-steps/src/Control/State/Transition/Simple.hs b/libs/small-steps/src/Control/State/Transition/Simple.hs index 371100c2d68..b9f1ca46081 100644 --- a/libs/small-steps/src/Control/State/Transition/Simple.hs +++ b/libs/small-steps/src/Control/State/Transition/Simple.hs @@ -1,5 +1,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeOperators #-} -- | Simple state transition system over the Identity monad. module Control.State.Transition.Simple ( diff --git a/libs/vector-map/vector-map.cabal b/libs/vector-map/vector-map.cabal index b1cd3b44109..a79627ccc8e 100644 --- a/libs/vector-map/vector-map.cabal +++ b/libs/vector-map/vector-map.cabal @@ -27,7 +27,7 @@ library -Wincomplete-uni-patterns -Wredundant-constraints -Wunused-packages build-depends: - base >=4.14 && <4.17, + base >=4.14 && <4.19, aeson, containers, deepseq,