Skip to content

Commit 44dc4d8

Browse files
committed
Adjust Babbage UtxowSpec for Dijkstra era
* Move tests that are reliant on certs w/out deposits and only run them pre-Dijkstra
1 parent d1e9955 commit 44dc4d8

File tree

5 files changed

+33
-7
lines changed
  • eras

5 files changed

+33
-7
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ spec = do
5454
Utxos.spec @era
5555

5656
instance EraSpecificSpec BabbageEra where
57-
eraSpecific = AlonzoUtxow.shelleyCertsSpec
57+
eraSpecific =
58+
AlonzoUtxow.shelleyCertsSpec
59+
>> Utxow.shelleyCertsSpec

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
{-# LANGUAGE OverloadedStrings #-}
55
{-# LANGUAGE ScopedTypeVariables #-}
66

7-
module Test.Cardano.Ledger.Babbage.Imp.UtxowSpec (spec) where
7+
module Test.Cardano.Ledger.Babbage.Imp.UtxowSpec (spec, shelleyCertsSpec) where
88

99
import Cardano.Ledger.Alonzo.Plutus.Context (ContextError)
1010
import Cardano.Ledger.Alonzo.Rules (AlonzoUtxosPredFailure, AlonzoUtxowPredFailure)
11-
import Cardano.Ledger.Babbage.Core (BabbageEraTxBody, InjectRuleFailure)
11+
import Cardano.Ledger.Babbage.Core (BabbageEraTxBody, InjectRuleFailure, ShelleyEraTxCert)
1212
import Cardano.Ledger.Babbage.Rules (BabbageUtxowPredFailure)
1313
import Cardano.Ledger.Babbage.TxInfo (BabbageContextError)
1414
import Cardano.Ledger.BaseTypes (Inject)
@@ -33,3 +33,14 @@ spec = do
3333
describe "UTXOW" $ do
3434
Valid.spec
3535
Invalid.spec
36+
37+
shelleyCertsSpec ::
38+
forall era.
39+
( AlonzoEraImp era
40+
, BabbageEraTxBody era
41+
, ShelleyEraTxCert era
42+
) =>
43+
SpecWith (ImpInit (LedgerSpec era))
44+
shelleyCertsSpec = do
45+
describe "UTXOW - certificates without deposits" $ do
46+
Valid.shelleyCertsSpec

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{-# LANGUAGE ScopedTypeVariables #-}
44
{-# LANGUAGE TypeApplications #-}
55

6-
module Test.Cardano.Ledger.Babbage.Imp.UtxowSpec.Valid (spec) where
6+
module Test.Cardano.Ledger.Babbage.Imp.UtxowSpec.Valid (spec, shelleyCertsSpec) where
77

88
import Cardano.Ledger.Alonzo.TxWits (unTxDatsL)
99
import Cardano.Ledger.Babbage.Core
@@ -171,6 +171,17 @@ spec = describe "Valid" $ do
171171
& bodyTxL . inputsTxBodyL .~ [txInAt 0 txInitial]
172172
& bodyTxL . referenceInputsTxBodyL .~ [txInAt 1 txInitial]
173173

174+
shelleyCertsSpec ::
175+
forall era.
176+
( AlonzoEraImp era
177+
, BabbageEraTxBody era
178+
, ShelleyEraTxCert era
179+
) =>
180+
SpecWith (ImpInit (LedgerSpec era))
181+
shelleyCertsSpec = describe "Valid" $ do
182+
forM_ @[] [PlutusV2 .. eraMaxLanguage @era] $ \slang -> do
183+
describe (show slang) $ do
184+
withSLanguage slang $ \lang -> do
174185
it "Use a reference script to authorize a delegation certificate" $ do
175186
addr <- freshKeyAddr_
176187
plutus <- mkPlutusScript $ alwaysSucceedsNoDatum lang

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import qualified Test.Cardano.Ledger.Conway.Imp.LedgerSpec as Ledger
5858
import qualified Test.Cardano.Ledger.Conway.Imp.RatifySpec as Ratify
5959
import qualified Test.Cardano.Ledger.Conway.Imp.UtxoSpec as Utxo
6060
import qualified Test.Cardano.Ledger.Conway.Imp.UtxosSpec as Utxos
61-
-- import qualified Test.Cardano.Ledger.Conway.Imp.UtxowSpec as Utxow
61+
import qualified Test.Cardano.Ledger.Conway.Imp.UtxowSpec as Utxow
6262
import Test.Cardano.Ledger.Conway.ImpTest (
6363
ConwayEraImp,
6464
LedgerSpec,
@@ -151,8 +151,7 @@ conwayEraGenericSpec = do
151151
describe "RATIFY" Ratify.spec
152152
describe "UTXO" Utxo.spec
153153
describe "UTXOS" Utxos.spec
154-
155-
-- describe "UTXOW" Utxow.spec
154+
describe "UTXOW" Utxow.spec
156155

157156
conwayEraSpecificSpec ::
158157
( ConwayEraImp era

eras/dijkstra/testlib/Test/Cardano/Ledger/Dijkstra/Imp.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Cardano.Ledger.Conway.Rules
1717
import Cardano.Ledger.Conway.TxInfo
1818
import Cardano.Ledger.Dijkstra (DijkstraEra)
1919
import Cardano.Ledger.Dijkstra.Core
20+
import Cardano.Ledger.Plutus
2021
import Cardano.Ledger.Shelley.API
2122
import Cardano.Ledger.Shelley.Rules
2223
import Data.Typeable (Typeable)
@@ -43,6 +44,7 @@ spec ::
4344
, InjectRuleFailure "LEDGER" ConwayGovCertPredFailure era
4445
, InjectRuleFailure "LEDGER" ConwayLedgerPredFailure era
4546
, InjectRuleFailure "LEDGER" ConwayUtxoPredFailure era
47+
, InjectRuleFailure "LEDGER" ConwayUtxowPredFailure era
4648
, InjectRuleFailure "BBODY" ConwayBbodyPredFailure era
4749
, InjectRuleEvent "TICK" ConwayEpochEvent era
4850
, Event (EraRule "EPOCH" era) ~ ConwayEpochEvent era
@@ -54,6 +56,7 @@ spec ::
5456
, Eq (Event (EraRule "ENACT" era))
5557
, Typeable (Event (EraRule "ENACT" era))
5658
, ToExpr (Event (EraRule "BBODY" era))
59+
, EraPlutusTxInfo PlutusV2 era
5760
) =>
5861
Spec
5962
spec = ConwayImp.spec @era

0 commit comments

Comments
 (0)