Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include datums and redeemers in makeUnsignedTx #623

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading