Skip to content

Commit

Permalink
test Conway TxInfo (and generalize Babbage)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Corduan committed Mar 30, 2023
1 parent 6a93ef2 commit 2087c79
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 289 deletions.
16 changes: 10 additions & 6 deletions eras/alonzo/test-suite/test/Test/Cardano/Ledger/Alonzo/TxInfo.hs
Expand Up @@ -122,6 +122,13 @@ transVITimeUpperBoundIsOpen = do
Left e -> assertFailure $ "no translation error was expected, but got: " <> show e
Right t -> t @?= (PV1.Interval (PV1.LowerBound PV1.NegInf True) (PV1.UpperBound (PV1.Finite (PV1.POSIXTime 40000)) False))

expectLanguageNotSupported :: Language -> Assertion
expectLanguageNotSupported lang =
expectTranslationError
lang
(txEx shelleyInput shelleyOutput)
(LanguageNotSupported lang)

tests :: TestTree
tests =
testGroup
Expand All @@ -134,12 +141,9 @@ tests =
silentlyIgnore (txEx byronInput shelleyOutput)
]
, testGroup
"Plutus V2"
[ testCase "translation error for V2 in Alonzo" $
expectTranslationError
PlutusV2
(txEx shelleyInput shelleyOutput)
(LanguageNotSupported PlutusV2)
"Plutus VX, X > 1"
[ testCase "translation error for V2 in Alonzo" (expectLanguageNotSupported PlutusV2)
, testCase "translation error for V3 in Alonzo" (expectLanguageNotSupported PlutusV3)
]
, testGroup
"transVITime"
Expand Down
20 changes: 8 additions & 12 deletions eras/babbage/test-suite/cardano-ledger-babbage-test.cabal
Expand Up @@ -23,6 +23,7 @@ library
exposed-modules:
Test.Cardano.Ledger.Babbage.Examples.Consensus
Test.Cardano.Ledger.Babbage.Serialisation.Generators
Test.Cardano.Ledger.Babbage.TxInfo

hs-source-dirs: src
default-language: Haskell2010
Expand All @@ -49,7 +50,11 @@ library
data-default-class,
microlens,
plutus-tx,
QuickCheck
QuickCheck,
time,
plutus-ledger-api,
tasty,
tasty-hunit

test-suite cardano-ledger-babbage-test
type: exitcode-stdio-1.0
Expand All @@ -58,7 +63,6 @@ test-suite cardano-ledger-babbage-test
other-modules:
Test.Cardano.Ledger.Babbage.Serialisation.Tripping
Test.Cardano.Ledger.Babbage.Serialisation.CDDL
Test.Cardano.Ledger.Babbage.TxInfo
Paths_cardano_ledger_babbage_test

default-language: Haskell2010
Expand All @@ -72,20 +76,12 @@ test-suite cardano-ledger-babbage-test
bytestring,
cardano-ledger-binary:{cardano-ledger-binary, testlib},
cardano-ledger-allegra,
cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib},
cardano-ledger-alonzo,
cardano-ledger-babbage:{cardano-ledger-babbage, testlib},
cardano-ledger-babbage-test >=1.1,
cardano-ledger-core,
cardano-ledger-shelley,
cardano-ledger-shelley-ma-test,
cardano-ledger-shelley-test,
cardano-protocol-tpraos >=1.0,
cardano-slotting,
containers,
data-default-class,
plutus-ledger-api,
cardano-strict-containers,
tasty,
tasty-hunit,
tasty-quickcheck,
time
tasty

0 comments on commit 2087c79

Please sign in to comment.