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 @@ -115,12 +115,15 @@ prop_roundtrip_tx_out_CBOR = H.property $ do
115115 AnyShelleyBasedEra era <- H. noteShowM . H. forAll $ Gen. element [minBound .. maxBound ]
116116 x <- H. forAll $ genTx era
117117 txOut <- H. forAll $ Gen. element $ txOuts $ getTxBodyContent $ getTxBody x
118- txOutRT <- H. evalEither $ rtOnce era txOut -- We do this because some information gets lost on serialisation
119- shelleyBasedEraConstraints era $ H. trippingCbor (proxyToAsType Proxy ) txOutRT
118+ let fixedTxOut = hashDatum txOut
119+ shelleyBasedEraConstraints era $ H. trippingCbor (proxyToAsType Proxy ) fixedTxOut
120120 where
121- rtOnce
122- :: ShelleyBasedEra era -> TxOut CtxTx era -> Either CBOR. DecoderError (TxOut CtxTx era )
123- rtOnce sbe t = shelleyBasedEraConstraints sbe $ deserialiseFromCBOR (proxyToAsType Proxy ) (serialiseToCBOR t)
121+ hashDatum :: TxOut CtxTx era -> TxOut CtxTx era
122+ hashDatum txOut@ (TxOut aie val datum rs) =
123+ case datum of
124+ (TxOutSupplementalDatum aeo d) ->
125+ (TxOut aie val (TxOutDatumHash aeo (hashScriptDataBytes d)) rs)
126+ _ -> txOut
124127
125128prop_roundtrip_witness_CBOR :: Property
126129prop_roundtrip_witness_CBOR = H. property $ do
You can’t perform that action at this time.
0 commit comments