user2794: The following code would work for V1:
outputDatum :: EkivalEscrowDatum
outputDatum = case transferDatum $ txOutDatumHash ownOutput >>= flip findDatum info of

    Nothing -> traceError "Transfer output datum not found"

    Just d  -> d

However, "txOutDatumHash" seems to be missing a corresponding implementation in V2.
I understand we may face inline Datum, which would not include the Hash, but backward compatibility appears to not be fully implemented on this function.
From the plutus-apps examples, I noticed a mixture of V1 modules whenever the datum was being verified.
PS: transferDatum :: Maybe Datum -> Maybe EkivalEscrowDatum

user1071: Looking at the API:
V1's TxOut uses txOutDatumHash :: Maybe DatumHash
V2's TxOut uses txOutDatum :: OutputDatum
where data OutputDatum = NoOutputDatum | OutputDatumHash DatumHash | OutputDatum Datum
So V2 still has DatumHash but you need to also handle the possibility of OutputDatum (inline datum).

2794: <p>The following code would work for V1:
outputDatum :: EkivalEscrowDatum</p>
<pre><code>outputDatum = case transferDatum $ txOutDatumHash ownOutput &gt;&gt;= flip findDatum info of

    Nothing -&gt; traceError &quot;Transfer output datum not found&quot;

    Just d  -&gt; d
</code></pre>
<p>However, &quot;txOutDatumHash&quot; seems to be missing a corresponding implementation in V2.
I understand we may face inline Datum, which would not include the Hash, but backward compatibility appears to not be fully implemented on this function.
From the plutus-apps examples, I noticed a mixture of V1 modules whenever the datum was being verified.
PS: transferDatum :: Maybe Datum -&gt; Maybe EkivalEscrowDatum</p>
 1071: <p>Looking at the API:</p>
<p>V1's <code>TxOut</code> uses <code>txOutDatumHash :: Maybe DatumHash</code></p>
<p>V2's <code>TxOut</code> uses <code>txOutDatum :: OutputDatum</code>
where <code>data OutputDatum = NoOutputDatum | OutputDatumHash DatumHash | OutputDatum Datum</code></p>
<p>So V2 still has DatumHash but you need to also handle the possibility of OutputDatum (inline datum).</p>
