Closed manupadillaph closed 1 year ago
It is intentional.
TxOutDatumHash
stores the datum hash at outputTxOutDatumInTx
stores the datum hash at the output and embeds the datum value in the txbodyTxOutDatumInline
stores the datum value at the output (supported from Babbage era)If using TxOutDatumInTx
, you must query the blockchain for the datum value. E.g. using a chain follower like db-sync.
Summary
The method fromCardanoTxOutDatum to convert from C.TxOutDatum C.CtxTx era to PV2.OutputDatum is creating a OutputDatumHash when is receiving a datum in the type of TxOutDatumInTx, instead of returning a PV2.OutputDatum.
Don't know if it is intentional or a bug.
Steps to reproduce the behavior
Use the method to convert a datum with era, attached to a tx, TxOutDatumInTx , to a OutputDatum and you will get only the hash. Not the body of the datum.
Actual Result
The Hash of the TxOutDatumHash
Expected Result
To get the body of the datum
Describe the approach you would take to fix this
Change this line in plutus-ledger/src/Ledger/Tx/CardanoAPI/Internal.hs
System info
Plutus v1.1.0 and 1.2.0