File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
cardano-api/test/cardano-api-test/Test/Cardano/Api Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,15 @@ prop_roundtrip_tx_out_CBOR = H.property $ do
113113 AnyShelleyBasedEra era <- H. noteShowM . H. forAll $ Gen. element [minBound .. maxBound ]
114114 x <- H. forAll $ genTx era
115115 txOut <- H. forAll $ Gen. element $ txOuts $ getTxBodyContent $ getTxBody x
116- txOutRT <- H. evalEither $ rtOnce era txOut -- We do this because some information gets lost on serialisation
117- shelleyBasedEraConstraints era $ H. trippingCbor (proxyToAsType Proxy ) txOutRT
116+ let fixedTxOut = hashDatum txOut
117+ shelleyBasedEraConstraints era $ H. trippingCbor (proxyToAsType Proxy ) fixedTxOut
118118 where
119- rtOnce
120- :: ShelleyBasedEra era -> TxOut CtxTx era -> Either CBOR. DecoderError (TxOut CtxTx era )
121- rtOnce sbe t = shelleyBasedEraConstraints sbe $ deserialiseFromCBOR (proxyToAsType Proxy ) (serialiseToCBOR t)
119+ hashDatum :: TxOut CtxTx era -> TxOut CtxTx era
120+ hashDatum txOut@ (TxOut aie val datum rs) =
121+ case datum of
122+ (TxOutSupplementalDatum aeo d) ->
123+ TxOut aie val (TxOutDatumHash aeo (hashScriptDataBytes d)) rs
124+ _ -> txOut
122125
123126prop_roundtrip_witness_CBOR :: Property
124127prop_roundtrip_witness_CBOR = H. property $ do
You can’t perform that action at this time.
0 commit comments