Skip to content

Commit

Permalink
Merge pull request #623 from IntersectMBO/jordan/add-script-datums-an…
Browse files Browse the repository at this point in the history
…d-redeemers-in-makeUnsignedTx

Include datums and redeemers in makeUnsignedTx
  • Loading branch information
carbolymer authored Aug 29, 2024
2 parents 966462b + 3568b89 commit 3e93876
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 3e93876

Please sign in to comment.