Skip to content

Commit 04c6cdc

Browse files
committed
Use EraTest classes in ImpTests
1 parent 625a664 commit 04c6cdc

File tree

15 files changed

+19
-62
lines changed

15 files changed

+19
-62
lines changed

eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/Imp.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import Test.Cardano.Ledger.Shelley.ImpTest
1616

1717
spec ::
1818
forall era.
19-
( Arbitrary (TxAuxData era)
20-
, ShelleyEraImp era
19+
( ShelleyEraImp era
2120
, InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era
2221
, InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era
2322
) =>

eras/allegra/impl/testlib/Test/Cardano/Ledger/Allegra/ImpTest.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import qualified Data.Map.Strict as Map
3131
import Data.Sequence.Strict (StrictSeq (..))
3232
import qualified Data.Set as Set
3333
import Lens.Micro ((^.))
34+
import Test.Cardano.Ledger.Allegra.Era ()
3435
import Test.Cardano.Ledger.Allegra.TreeDiff ()
3536
import Test.Cardano.Ledger.Core.KeyPair (KeyPair)
3637
import Test.Cardano.Ledger.Shelley.ImpTest

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import qualified Test.Cardano.Ledger.Mary.Imp as MaryImp
2727

2828
spec ::
2929
forall era.
30-
( Arbitrary (TxAuxData era)
31-
, AlonzoEraImp era
30+
( AlonzoEraImp era
3231
, InjectRuleFailure "LEDGER" ShelleyDelegPredFailure era
3332
, InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era
3433
, InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import Cardano.Ledger.Alonzo (AlonzoEra)
4646
import Cardano.Ledger.Alonzo.Core
4747
import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis (..))
4848
import Cardano.Ledger.Alonzo.PParams (getLanguageView)
49-
import Cardano.Ledger.Alonzo.Plutus.Context (EraPlutusContext)
5049
import Cardano.Ledger.Alonzo.Plutus.Evaluate (
5150
collectPlutusScriptsWithContext,
5251
evalPlutusScriptsWithLogs,
@@ -61,7 +60,7 @@ import Cardano.Ledger.Alonzo.Scripts (plutusScriptLanguage, toAsItem, toAsIx)
6160
import Cardano.Ledger.Alonzo.Tx (IsValid (..), hashScriptIntegrity)
6261
import Cardano.Ledger.Alonzo.TxAuxData (AlonzoTxAuxData)
6362
import Cardano.Ledger.Alonzo.TxWits (unRedeemersL, unTxDatsL)
64-
import Cardano.Ledger.Alonzo.UTxO (AlonzoEraUTxO (..), AlonzoScriptsNeeded (..))
63+
import Cardano.Ledger.Alonzo.UTxO (AlonzoScriptsNeeded (..))
6564
import Cardano.Ledger.BaseTypes (Globals (..), StrictMaybe (..))
6665
import Cardano.Ledger.Coin (Coin (..))
6766
import Cardano.Ledger.Credential (Credential (..))
@@ -97,6 +96,7 @@ import qualified Data.Set as Set
9796
import Lens.Micro
9897
import Lens.Micro.Mtl (use)
9998
import qualified PlutusLedgerApi.Common as P
99+
import Test.Cardano.Ledger.Alonzo.Era
100100
import Test.Cardano.Ledger.Alonzo.TreeDiff ()
101101
import Test.Cardano.Ledger.Core.Arbitrary ()
102102
import Test.Cardano.Ledger.Core.Rational ((%!))
@@ -112,11 +112,7 @@ import Test.Cardano.Ledger.Plutus.Guardrail (guardrailScript)
112112

113113
class
114114
( MaryEraImp era
115-
, AlonzoEraScript era
116-
, AlonzoEraTxWits era
117-
, AlonzoEraTx era
118-
, AlonzoEraUTxO era
119-
, EraPlutusContext era
115+
, AlonzoEraTest era
120116
, ScriptsNeeded era ~ AlonzoScriptsNeeded era
121117
, TxAuxData era ~ AlonzoTxAuxData era
122118
) =>

eras/babbage/impl/testlib/Test/Cardano/Ledger/Babbage/Imp.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ import Test.Cardano.Ledger.Imp.Common
2929

3030
spec ::
3131
forall era.
32-
( Arbitrary (TxAuxData era)
33-
, AlonzoEraImp era
32+
( AlonzoEraImp era
3433
, BabbageEraTxBody era
3534
, InjectRuleFailure "LEDGER" ShelleyDelegPredFailure era
3635
, InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era

eras/babbage/impl/testlib/Test/Cardano/Ledger/Babbage/ImpTest.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import qualified Data.Sequence.Strict as SSeq
4141
import GHC.Stack (HasCallStack)
4242
import Lens.Micro
4343
import Test.Cardano.Ledger.Alonzo.ImpTest
44+
import Test.Cardano.Ledger.Babbage.Era ()
4445
import Test.Cardano.Ledger.Babbage.TreeDiff ()
4546
import Test.Cardano.Ledger.Plutus (testingCostModels)
4647

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ import Test.Cardano.Ledger.Shelley.ImpTest (ImpInit)
6161

6262
spec ::
6363
forall era.
64-
( Arbitrary (TxAuxData era)
65-
, ConwayEraImp era
66-
, EraSegWits era
64+
( ConwayEraImp era
6765
, Inject (BabbageContextError era) (ContextError era)
6866
, Inject (ConwayContextError era) (ContextError era)
6967
, InjectRuleFailure "LEDGER" ConwayGovPredFailure era
@@ -103,7 +101,6 @@ spec = do
103101
conwaySpec ::
104102
forall era.
105103
( ConwayEraImp era
106-
, EraSegWits era
107104
, Inject (BabbageContextError era) (ContextError era)
108105
, Inject (ConwayContextError era) (ContextError era)
109106
, InjectRuleFailure "LEDGER" ConwayGovPredFailure era

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/BbodySpec.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ spec ::
4444
forall era.
4545
( AlonzoEraImp era
4646
, BabbageEraTxBody era
47-
, EraSegWits era
4847
, InjectRuleFailure "BBODY" ConwayBbodyPredFailure era
4948
) =>
5049
SpecWith (ImpInit (LedgerSpec era))

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ module Test.Cardano.Ledger.Conway.ImpTest (
139139

140140
import Cardano.Ledger.Address (RewardAccount (..))
141141
import Cardano.Ledger.Allegra.Scripts (Timelock)
142-
import Cardano.Ledger.Alonzo.Scripts (AlonzoScript)
143142
import Cardano.Ledger.BaseTypes (
144143
EpochInterval (..),
145144
EpochNo (..),
@@ -225,6 +224,7 @@ import Lens.Micro
225224
import Prettyprinter (align, hsep, viaShow, vsep)
226225
import Test.Cardano.Ledger.Babbage.ImpTest
227226
import Test.Cardano.Ledger.Conway.Arbitrary ()
227+
import Test.Cardano.Ledger.Conway.Era
228228
import Test.Cardano.Ledger.Conway.TreeDiff (tableDoc)
229229
import Test.Cardano.Ledger.Core.Rational (IsRatio (..))
230230
import Test.Cardano.Ledger.Imp.Common
@@ -316,18 +316,14 @@ instance AlonzoEraImp ConwayEra where
316316

317317
class
318318
( AlonzoEraImp era
319-
, ConwayEraGov era
320-
, ConwayEraTxBody era
319+
, ConwayEraTest era
321320
, ConwayEraTxCert era
322-
, ConwayEraPParams era
323-
, ConwayEraCertState era
324321
, STS (EraRule "ENACT" era)
325322
, BaseM (EraRule "ENACT" era) ~ ShelleyBase
326323
, State (EraRule "ENACT" era) ~ EnactState era
327324
, Signal (EraRule "ENACT" era) ~ EnactSignal era
328325
, Environment (EraRule "ENACT" era) ~ ()
329326
, NativeScript era ~ Timelock era
330-
, Script era ~ AlonzoScript era
331327
, GovState era ~ ConwayGovState era
332328
) =>
333329
ConwayEraImp era

eras/mary/impl/testlib/Test/Cardano/Ledger/Mary/Imp.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
module Test.Cardano.Ledger.Mary.Imp (spec) where
99

10-
import Cardano.Ledger.Allegra.Scripts
1110
import Cardano.Ledger.Mary.Core
1211
import Cardano.Ledger.Shelley.Rules (ShelleyUtxoPredFailure, ShelleyUtxowPredFailure)
1312
import qualified Test.Cardano.Ledger.Allegra.Imp as AllegraImp
@@ -18,9 +17,7 @@ import Test.Cardano.Ledger.Shelley.ImpTest (LedgerSpec)
1817

1918
spec ::
2019
forall era.
21-
( Arbitrary (TxAuxData era)
22-
, MaryEraImp era
23-
, AllegraEraScript era
20+
( MaryEraImp era
2421
, InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era
2522
, InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era
2623
) =>

0 commit comments

Comments
 (0)