Skip to content

Commit 3a006d6

Browse files
committed
Remove Pretty from cardano-ledger-test
1 parent 12acadc commit 3a006d6

File tree

67 files changed

+1080
-5512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1080
-5512
lines changed

eras/alonzo/impl/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.14.0.0
44

5+
* Added `Generic` instance for `AlonzoScriptsNeeded`
56
* Move to `testlib` `DecCBOR` instances for: `AlonzoTxSeq`, `AlonzoTx`, `TxBody AlonzoEra`, `AlonzoTxAuxDataRaw`, `AlonzoTxAuxData`, `AlonzoScript`, `AlonzoTxWitsRaw`, `AlonzoTxWits`, `RedeemersRaw`, `Redeemers`, `TxDatsRaw`, `TxDats`
67
* Added to `PParams`: `ppCollateralPercentage`,`ppCostModels`,`ppMaxBlockExUnits`,`ppMaxCollateralInputs`,`ppMaxTxExUnits`,`ppMaxValSize`,`ppPrices`
78
* Removed `alonzoCommonPParamsHKDPairs` from `PParams`
@@ -21,6 +22,11 @@
2122

2223
### `testlib`
2324

25+
* Added `ToExpr` instances for:
26+
* `AsIxItem`
27+
* `AlonzoScriptsNeeded`
28+
* `AlonzoPlutusPurpose AsIxItem`
29+
* `AlonzoBbodyPredFailure`
2430
* Deprecated `mkPlutusScript'`
2531
* Change type signature of `genPlutusScript`, `genNativeScript`, `genAlonzoScript`, `alwaysSucceedsLang` and `alwaysFailsLang`.
2632
* Remove `TxInfoLanguage` and `mkTxInfoLanguage`

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/UTxO.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE DataKinds #-}
3+
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE FlexibleContexts #-}
45
{-# LANGUAGE FlexibleInstances #-}
56
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -63,13 +64,14 @@ import qualified Data.Map.Strict as Map
6364
import Data.Maybe (catMaybes, fromMaybe, isJust)
6465
import qualified Data.Set as Set
6566
import Data.Word (Word32)
67+
import GHC.Generics
6668
import Lens.Micro ((^.))
6769
import Lens.Micro.Extras (view)
6870

6971
-- | Alonzo era style `ScriptsNeeded` require also a `PlutusPurpose`, not only the `ScriptHash`
7072
newtype AlonzoScriptsNeeded era
7173
= AlonzoScriptsNeeded [(PlutusPurpose AsIxItem era, ScriptHash)]
72-
deriving (Monoid, Semigroup)
74+
deriving (Monoid, Semigroup, Generic)
7375

7476
deriving instance AlonzoEraScript era => Eq (AlonzoScriptsNeeded era)
7577

eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Era.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class
2626
, AlonzoEraTxAuxData era
2727
, AlonzoEraUTxO era
2828
, ToExpr (PlutusScript era)
29+
, ToExpr (PlutusPurpose AsIx era)
30+
, ToExpr (PlutusPurpose AsIxItem era)
2931
, Script era ~ AlonzoScript era
3032
) =>
3133
AlonzoEraTest era

eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/TreeDiff.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Cardano.Ledger.Alonzo.Tx
2525
import Cardano.Ledger.Alonzo.TxAuxData
2626
import Cardano.Ledger.Alonzo.TxBody
2727
import Cardano.Ledger.Alonzo.TxWits
28+
import Cardano.Ledger.Alonzo.UTxO
2829
import Cardano.Ledger.BaseTypes
2930
import Cardano.Ledger.Compactible
3031
import Cardano.Ledger.Plutus.Evaluate (PlutusWithContext (..))
@@ -45,6 +46,12 @@ deriving newtype instance ToExpr ix => ToExpr (AsIx ix it)
4546

4647
deriving newtype instance ToExpr it => ToExpr (AsItem ix it)
4748

49+
instance (ToExpr ix, ToExpr it) => ToExpr (AsIxItem ix it)
50+
51+
instance ToExpr (PlutusPurpose AsIxItem era) => ToExpr (AlonzoScriptsNeeded era)
52+
53+
instance ToExpr (TxCert era) => ToExpr (AlonzoPlutusPurpose AsIxItem era)
54+
4855
-- Core
4956
deriving newtype instance ToExpr CoinPerWord
5057

@@ -168,3 +175,7 @@ instance
168175
, ("pwcExUnits", toExpr pwcExUnits)
169176
, ("pwcCostModel", toExpr pwcCostModel)
170177
]
178+
179+
instance
180+
ToExpr (PredicateFailure (EraRule "LEDGERS" era)) =>
181+
ToExpr (AlonzoBbodyPredFailure era)

eras/conway/impl/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
### `testlib`
3030

31+
* Added `ToExpr` instances for:
32+
* `ConwayPlutusPurpose AsIxItem`
33+
* `DRepPulser`
34+
* `ConwayBbodyPredFailure`
3135
* Added `Era` module with `ConwayEraTest` class
3236

3337
## 1.19.0.0

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/TreeDiff.hs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ instance
4646
) =>
4747
ToExpr (ConwayPlutusPurpose AsItem era)
4848

49+
instance
50+
( ToExpr (TxCert era)
51+
, ToExpr (PParamsHKD StrictMaybe era)
52+
) =>
53+
ToExpr (ConwayPlutusPurpose AsIxItem era)
54+
4955
-- PlutusContext
5056
instance
5157
( Era era
@@ -127,6 +133,17 @@ instance
127133
where
128134
(a, b) = finishDRepPulser x
129135

136+
instance
137+
( EraStake era
138+
, EraPParams era
139+
, ToExpr (DRepPulsingState era)
140+
, ToExpr (RatifyState era)
141+
, ToExpr (PParamsHKD StrictMaybe era)
142+
) =>
143+
ToExpr (DRepPulser era Identity (RatifyState era))
144+
where
145+
toExpr = toExpr . finishDRepPulser . DRPulsing
146+
130147
instance ToExpr (InstantStake era) => ToExpr (RatifyEnv era) where
131148
toExpr (RatifyEnv stake pool drep dstate ep cs delegatees poolps) =
132149
App
@@ -291,3 +308,7 @@ instance
291308
instance ToExpr (VState era)
292309

293310
instance ConwayEraCertState era => ToExpr (ConwayCertState era)
311+
312+
instance
313+
ToExpr (PredicateFailure (EraRule "LEDGERS" era)) =>
314+
ToExpr (ConwayBbodyPredFailure era)

eras/shelley/impl/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## 1.17.0.0
44

5+
* Added `Generic` instances for:
6+
* `ShelleyBbodyState`
7+
* `ShelleyScriptsNeeded`
58
* Remove Bool argument from `auxDataSeqDecoder`
69
* Move to `testlib` `DecCBOR` instances for: `ShelleyTxSeq`, `ShelleyTxRaw`, `ShelleyTx`, `TxBody ShelleyEra`, `ShelleyTxAuxData`, `ShelleyTxWitsRaw`, `ShelleyTxWits`, `MultiSigRaw`, `MultiSig`
710
* Remove `segWitTx`
@@ -37,6 +40,17 @@
3740

3841
### `testlib`
3942

43+
* Added `ToExpr` instances for:
44+
* `ShelleyScriptsNeeded`
45+
* `ShelleyBbodyState`
46+
* `ShelleyTickPredFailure`
47+
* `ShelleyNewEpochPredFailure`
48+
* `ShelleyEpochPredFailure`
49+
* `ShelleyUpecPredFailure`
50+
* `ShelleyPoolPredFailure`
51+
* `ShelleySnapPredFailure`
52+
* `ShelleyMirPredFailure`
53+
* `ShelleyRupdPredFailure`
4054
* Added `Era` module with `ShelleyEraTest` class
4155

4256
## 1.16.0.0

eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Bbody.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import NoThunks.Class (NoThunks (..))
6565

6666
data ShelleyBbodyState era
6767
= BbodyState !(State (EraRule "LEDGERS" era)) !BlocksMade
68+
deriving (Generic)
6869

6970
deriving stock instance Show (State (EraRule "LEDGERS" era)) => Show (ShelleyBbodyState era)
7071

eras/shelley/impl/src/Cardano/Ledger/Shelley/UTxO.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{-# LANGUAGE BlockArguments #-}
44
{-# LANGUAGE ConstraintKinds #-}
55
{-# LANGUAGE DataKinds #-}
6+
{-# LANGUAGE DeriveGeneric #-}
67
{-# LANGUAGE DerivingVia #-}
78
{-# LANGUAGE FlexibleContexts #-}
89
{-# LANGUAGE FlexibleInstances #-}
@@ -79,6 +80,7 @@ import Data.Foldable (Foldable (fold), foldr', toList)
7980
import qualified Data.Map.Strict as Map
8081
import Data.Set (Set)
8182
import qualified Data.Set as Set
83+
import GHC.Generics (Generic)
8284
import Lens.Micro ((^.))
8385

8486
-- | Compute the subset of inputs of the set 'txIns' for which each input is
@@ -172,7 +174,7 @@ getConsumedCoin pp lookupRefund utxo txBody =
172174
withdrawals = fold . unWithdrawals $ txBody ^. withdrawalsTxBodyL
173175

174176
newtype ShelleyScriptsNeeded era = ShelleyScriptsNeeded (Set ScriptHash)
175-
deriving (Eq, Show)
177+
deriving (Eq, Show, Generic)
176178

177179
instance EraUTxO ShelleyEra where
178180
type ScriptsNeeded ShelleyEra = ShelleyScriptsNeeded ShelleyEra

eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Era.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Test.Cardano.Ledger.Shelley.Era (
1010
import Cardano.Ledger.Shelley
1111
import Cardano.Ledger.Shelley.LedgerState
1212
import Cardano.Ledger.Shelley.Scripts
13+
import Cardano.Ledger.State
1314
import Data.Default
1415
import Test.Cardano.Ledger.Common
1516
import Test.Cardano.Ledger.Era
@@ -25,6 +26,7 @@ class
2526
, NFData (StashedAVVMAddresses era)
2627
, Default (StashedAVVMAddresses era)
2728
, Arbitrary (StashedAVVMAddresses era)
29+
, ToExpr (ScriptsNeeded era)
2830
) =>
2931
ShelleyEraTest era
3032

0 commit comments

Comments
 (0)