Skip to content

Commit ebca61c

Browse files
committed
Add property tests for Alonzo, Babbage and Conway Plutus TxInfo translation
Add `Test.Cardano.Ledger.Alonzo.TxInfoSpec` with three property tests for Alonzo TxInfo translation: * correctly translate tx with alonzo-era features * translation fails when input not in UTxO * translation fails for slot past horizon Extend `Test.Cardano.Ledger.Babbage.TxInfoSpec` with a property test for Babbage TxInfo translation across PlutusV1/V2/V3/V4: * correctly translate tx with babbage-era features
1 parent f51f4e4 commit ebca61c

6 files changed

Lines changed: 914 additions & 153 deletions

File tree

eras/alonzo/impl/cardano-ledger-alonzo.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ library testlib
179179
Test.Cardano.Ledger.Alonzo.Translation.TranslatableGen
180180
Test.Cardano.Ledger.Alonzo.Translation.TranslationInstance
181181
Test.Cardano.Ledger.Alonzo.TreeDiff
182+
Test.Cardano.Ledger.Alonzo.TxInfoSpec
182183

183184
visibility: public
184185
hs-source-dirs: testlib
@@ -223,6 +224,7 @@ library testlib
223224
microlens-mtl,
224225
mtl,
225226
plutus-ledger-api,
227+
plutus-tx,
226228
serialise,
227229
text,
228230
time,

eras/alonzo/impl/test/Main.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import qualified Test.Cardano.Ledger.Alonzo.GoldenTranslation as GoldenTranslati
1313
import qualified Test.Cardano.Ledger.Alonzo.Imp as Imp
1414
import qualified Test.Cardano.Ledger.Alonzo.Imp.TxInfoSpec as TxInfoImp
1515
import Test.Cardano.Ledger.Alonzo.ImpTest ()
16+
import qualified Test.Cardano.Ledger.Alonzo.TxInfoSpec as TxInfoSpec
1617
import Test.Cardano.Ledger.Common
1718
import Test.Cardano.Ledger.Core.JSON (roundTripJsonEraSpec)
1819
import Test.Cardano.Ledger.Shelley.JSON (roundTripJsonShelleyEraSpec)
@@ -35,3 +36,4 @@ main =
3536
describe "TxWits" $ do
3637
TxWitsSpec.spec @AlonzoEra
3738
TxInfoImp.spec
39+
TxInfoSpec.spec @AlonzoEra

0 commit comments

Comments
 (0)