Skip to content

Commit

Permalink
Include datums and redeemers in makeUnsignedTx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Aug 28, 2024
1 parent 966462b commit 3568b89
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cardano-api/internal/Cardano/Api/Experimental/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ makeUnsignedTx era bc = obtainCommonConstraints era $ do
scripts = convScripts apiScriptWitnesses
languages = convLanguages apiScriptWitnesses
sData = convScriptData sbe apiTxOuts apiScriptWitnesses

(datums, redeemers) = case sData of
TxBodyScriptData _ ds rs -> (ds, rs)
TxBodyNoScriptData -> (mempty, L.Redeemers mempty)
let setMint = convMintValue apiMintValue
setReqSignerHashes = convExtraKeyWitnesses apiExtraKeyWitnesses
ledgerTxBody =
Expand Down Expand Up @@ -117,6 +119,9 @@ makeUnsignedTx era bc = obtainCommonConstraints era $ do
[ (L.hashScript sw, sw)
| sw <- scripts
]
& L.datsTxWitsL .~ datums
& L.rdmrsTxWitsL .~ redeemers

eraSpecificTxBody <- eraSpecificLedgerTxBody era ledgerTxBody bc

return . UnsignedTx $
Expand Down

0 comments on commit 3568b89

Please sign in to comment.