Skip to content

Add regression test: makeUnsignedTx errors without protocol params for Plutus scripts#1201

Merged
Jimbo4350 merged 2 commits into
masterfrom
jordan/makeunsignedtx-plutus-pparams-regression
May 8, 2026
Merged

Add regression test: makeUnsignedTx errors without protocol params for Plutus scripts#1201
Jimbo4350 merged 2 commits into
masterfrom
jordan/makeunsignedtx-plutus-pparams-regression

Conversation

@Jimbo4350
Copy link
Copy Markdown
Contributor

Context

Companion regression test for #1181 ("makeUnsignedTx: error when Plutus scripts present without protocol params"), which merged the fix but landed without a regression test. This PR closes that gap.

How to trust this PR

  • Single test added to Test.Cardano.Api.Experimental: prop_makeUnsignedTx_plutus_without_pparams.
  • Builds a TxBodyContent with a Plutus spending witness and no protocol parameters, asserts makeUnsignedTx returns Left MakeUnsignedTxMissingProtocolParams.
  • Run:
    cabal test cardano-api-test -j4 --test-options='-p "/makeUnsignedTx/"'
    

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff
  • Changelog fragment added in .changes/ (will add once PR number is assigned)

Copilot AI review requested due to automatic review settings May 7, 2026 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a regression test ensuring makeUnsignedTx errors with MakeUnsignedTxMissingProtocolParams when Plutus script witnesses are present but protocol parameters are absent (covering #1181).

Changes:

  • Add prop_makeUnsignedTx_plutus_without_pparams regression test to Test.Cardano.Api.Experimental.
  • Introduce a dedicated makeUnsignedTx test group in the experimental test suite.
  • Add a .changes/ entry documenting the new regression test.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs Adds a regression property test asserting the expected makeUnsignedTx error when Plutus witnesses lack protocol params.
.changes/20260507_cardano_api_regression_test_makeunsignedtx_plutus_pparams.yml Adds a changelog fragment documenting the new test.

@@ -0,0 +1,6 @@
project: cardano-api
pr: 1201
, testGroup
"makeUnsignedTx"
[ testProperty
"Plutus scripts without protocol params returns MakeUnsignedTxMissingProtocolParams"
Comment on lines +18 to +21
import Cardano.Api.Experimental.AnyScriptWitness
( AnyPlutusScriptWitness (AnyPlutusSpendingScriptWitness)
, PlutusSpendingScriptWitness (PlutusSpendingScriptWitnessV3)
)
Comment on lines +606 to +607
AnyPlutusSpendingScriptWitness $
PlutusSpendingScriptWitnessV3 $
(Exp.PReferenceScript srcTxIn)
Exp.NoScriptDatum
dummyRedeemer
(Script.ExecutionUnits 0 0)
Copy link
Copy Markdown
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I tried to test it against before the fix, but it didn't even return an Either

@Jimbo4350 Jimbo4350 added this pull request to the merge queue May 8, 2026
Merged via the queue into master with commit aabb5d1 May 8, 2026
31 checks passed
@Jimbo4350 Jimbo4350 deleted the jordan/makeunsignedtx-plutus-pparams-regression branch May 8, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants