mkSpendOutputsOnlyTx should support reference scripts on key addresses
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- haskell
- Domain
- cli, testing-qa
Research direction
Start in Testnet.Process.Cli.Transaction at mkSpendOutputsOnlyTx and inspect how computeTxOuts builds arguments for PubKeyAddress and ScriptAddress. Compare the two branches and run the relevant transaction helper tests. Done means an optional reference script is handled for both output address types without changing existing behavior.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Haskell
- Stars
- 3.2k
- Forks
- 755
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/cardano-node
-
Stale
Difficulty 1/5 1-3 hours Newbie friendliness 75/100
IntersectMBO/cardano-node#6597 · 1 comment ·
-
Stale
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
IntersectMBO/cardano-node#6578 · 1 comment ·
-
needs triage
Difficulty 4/5 3-5 days Newbie friendliness 52/100
IntersectMBO/cardano-node#6698 ·
-
type: enhancement
IntersectMBO/cardano-node#6691 · 1 assignee ·
-
type: enhancement
IntersectMBO/cardano-node#6690 · 1 assignee ·
All issues in IntersectMBO/cardano-node
Similar issues
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
koalaman/shellcheck#3539 ·
-
time-manager-0.4.0 Openfailure: bounds
Difficulty 1/5 Under an hour Newbie friendliness 72/100
commercialhaskell/stackage#8122 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/phino#1350 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100