Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Nov 20, 2023
1 parent bb9bb7f commit 76da97b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ import Test.Tasty.Hedgehog (testProperty)

-- TODO: Need to add PaymentExtendedKey roundtrip tests however
-- we can't derive an Eq instance for Crypto.HD.XPrv

prop_roundtrip_txbody_CBOR :: Property
prop_roundtrip_txbody_CBOR = H.property $ do
AnyShelleyBasedEra era <- H.forAll $ Gen.element [minBound..maxBound]
x <- H.forAll $ makeSignedTransaction [] <$> genTxBody era
H.tripping x (serialiseTxLedgerCddl $ toCardanoEra era) (deserialiseTxLedgerCddl $ toCardanoEra era)
H.tripping x (serialiseTxLedgerCddl $ toCardanoEra era) (deserialiseTxLedgerCddl era)

prop_roundtrip_tx_CBOR :: Property
prop_roundtrip_tx_CBOR = H.property $ do
Expand Down Expand Up @@ -171,7 +170,7 @@ prop_roundtrip_Tx_Cddl :: Property
prop_roundtrip_Tx_Cddl = H.property $ do
AnyShelleyBasedEra era <- H.forAll $ Gen.element [minBound..maxBound]
x <- forAll $ genTx era
H.tripping x (serialiseTxLedgerCddl $ toCardanoEra era) (deserialiseTxLedgerCddl $ toCardanoEra era)
H.tripping x (serialiseTxLedgerCddl $ toCardanoEra era) (deserialiseTxLedgerCddl era)

prop_roundtrip_TxWitness_Cddl :: Property
prop_roundtrip_TxWitness_Cddl = H.property $ do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import Test.Tasty.Hedgehog (testProperty)
prop_roundtrip_txbodycontent_txouts:: Property
prop_roundtrip_txbodycontent_txouts =
H.property $ do
let era = BabbageEra
content <- H.forAll $ genTxBodyContent ShelleyBasedEraBabbage
let era = ShelleyBasedEraBabbage
content <- H.forAll $ genTxBodyContent era
-- Create the ledger body & auxiliaries
body <- case createAndValidateTransactionBody era content of
Left err -> annotateShow err >> failure
Expand Down

0 comments on commit 76da97b

Please sign in to comment.