Add regression test: makeUnsignedTx errors without protocol params for Plutus scripts#1201
Merged
Jimbo4350 merged 2 commits intoMay 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_pparamsregression test toTest.Cardano.Api.Experimental. - Introduce a dedicated
makeUnsignedTxtest 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) |
palas
approved these changes
May 8, 2026
Contributor
palas
left a comment
There was a problem hiding this comment.
👍 I tried to test it against before the fix, but it didn't even return an Either
carbolymer
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Test.Cardano.Api.Experimental:prop_makeUnsignedTx_plutus_without_pparams.TxBodyContentwith a Plutus spending witness and no protocol parameters, assertsmakeUnsignedTxreturnsLeft MakeUnsignedTxMissingProtocolParams.Checklist
.changes/(will add once PR number is assigned)