@@ -30,7 +30,7 @@ import Hydra.Ledger.Cardano (
30
30
)
31
31
import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs )
32
32
import Test.Cardano.Ledger.Babbage.Arbitrary ()
33
- import Test.QuickCheck (Property , checkCoverage , conjoin , counterexample , cover , forAll , forAllBlind , property , sized , vectorOf , (.&&.) , (===) )
33
+ import Test.QuickCheck (Property , checkCoverage , conjoin , counterexample , cover , forAll , forAllBlind , property , sized , vectorOf , withMaxSuccess , (.&&.) , (===) )
34
34
import Test.QuickCheck.Property (expectFailure )
35
35
import Test.Util (propCollisionResistant )
36
36
@@ -71,20 +71,9 @@ spec =
71
71
prop " Roundtrip CBOR encoding" $ roundtripCBOR @ Tx
72
72
73
73
prop " JSON encoding of Tx according to schema" $
74
- prop_validateJSONSchema @ Tx " api.json" $
75
- key " components" . key " schemas" . key " Transaction"
76
-
77
- -- TODO(SN): rather ensure we use the right (cardano-api's) witness format as a test
78
- it " parses a specific Tx" $ do
79
- let bs =
80
- " {\" witnesses\" :\
81
- \ {\" keys\" : [\" 825820db995fe25169d141cab9bbba92baa01f9f2e1ece7df4cb2ac05190f37fcc1f9d58400599ccd0028389216631446cf0f9a4b095bbed03c25537595aa5a2e107e3704a55050c4ee5198a0aa9fc88007791ef9f3847cd96f3cb9a430d1c2d81c817480c\" ]\
82
- \ },\
83
- \ \" body\" :{\" outputs\" :[{\" address\" :\" addr1vx35vu6aqmdw6uuc34gkpdymrpsd3lsuh6ffq6d9vja0s6spkenss\" ,\" value\" :{\" lovelace\" :14}}],\
84
- \ \" inputs\" :[\" 9fdc525c20bc00d9dfa9d14904b65e01910c0dfe3bb39865523c1e20eaeb0903#0\" ]\
85
- \ }\
86
- \ }"
87
- shouldParseJSONAs @ Tx bs
74
+ withMaxSuccess 5 $
75
+ prop_validateJSONSchema @ Tx " api.json" $
76
+ key " components" . key " schemas" . key " RawTransaction"
88
77
89
78
describe " applyTransactions" $ do
90
79
prop " works with valid transaction" appliesValidTransaction
@@ -108,7 +97,7 @@ spec =
108
97
it " produces realistic values" $
109
98
forAll genValue propRealisticValue
110
99
111
- shouldParseJSONAs :: forall a . FromJSON a => LByteString -> Expectation
100
+ shouldParseJSONAs :: forall a . ( HasCallStack , FromJSON a ) => LByteString -> Expectation
112
101
shouldParseJSONAs bs =
113
102
case Aeson. eitherDecode bs of
114
103
Left err -> failure err
0 commit comments