Summary
mkSpendOutputsOnlyTx in Testnet.Process.Cli.Transaction currently only attaches reference scripts (--tx-out-reference-script-file) to ScriptAddress outputs. The PubKeyAddress branch ignores the Maybe (File ScriptJSON In) parameter entirely.
This means publishing a reference script at a regular payment key address requires building the transaction manually with execCli' instead of using the helper.
Expected behavior
Both PubKeyAddress and ScriptAddress outputs should support the optional reference script attachment.
Current code
computeTxOuts =
concat <$> sequence
[ case txOut of
PubKeyAddress dstWallet ->
-- reference script parameter is ignored here
return ["--tx-out", T.unpack (paymentKeyInfoAddr dstWallet) <> "+" ++ show (unCoin amount)]
ScriptAddress (File referenceScriptJSON) -> do
...
return
( ["--tx-out", scriptAddress <> "+" ++ show (unCoin amount)]
<> maybe [] (\(File newRefScript) -> ["--tx-out-reference-script-file", newRefScript]) mNewRefScript
)
| (txOut, amount, mNewRefScript) <- txOutputs
]
Suggested fix
Add the --tx-out-reference-script-file handling to the PubKeyAddress branch as well.
Summary
mkSpendOutputsOnlyTxinTestnet.Process.Cli.Transactioncurrently only attaches reference scripts (--tx-out-reference-script-file) toScriptAddressoutputs. ThePubKeyAddressbranch ignores theMaybe (File ScriptJSON In)parameter entirely.This means publishing a reference script at a regular payment key address requires building the transaction manually with
execCli'instead of using the helper.Expected behavior
Both
PubKeyAddressandScriptAddressoutputs should support the optional reference script attachment.Current code
Suggested fix
Add the
--tx-out-reference-script-filehandling to thePubKeyAddressbranch as well.