Support Dijkstra simple scripts read from JSON - #1427
Merged
Conversation
Reading a JSON simple script in the Dijkstra era hit an error stub; upgrade the parsed Allegra-format timelock to the era's native script type via upgradeTimelock, the same conversion the api itself uses. Co-Authored-By: Mateusz Galazyn <mateusz.galazyn@iohk.io>
palas
requested review from
Jimbo4350,
carbolymer,
disassembler,
kevinhammond and
newhoggy
as code owners
August 27, 2026 10:59
carbolymer
reviewed
Aug 27, 2026
carbolymer
approved these changes
Aug 27, 2026
palas
added a commit
that referenced
this pull request
Aug 28, 2026
Decode the JSON SimpleScript once and convert it to a Conway timelock before the era case, so each era branch is a single expression; this drops the obtainConwayConstraints wrapper and the TypeApplications pragma. Suggested by the review of #1427.
Decode the JSON SimpleScript once and convert it to a Conway timelock before the era case, so each era branch is a single expression; this drops the obtainConwayConstraints wrapper and the TypeApplications pragma. Suggested by the review of #1427.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the remaining Dijkstra-era stub in the era-based simple-script JSON reading path by decoding JSON SimpleScripts into a Conway-native timelock and upgrading it to Dijkstra when needed, matching the conversion approach used elsewhere.
Changes:
- Add Dijkstra ledger scripts import and use
Dijkstra.upgradeTimelockwhen reading simple scripts from JSON for the Dijkstra era. - Refactor the JSON fallback path to decode once, build a Conway timelock, and then era-select the final native script.
- Add a changelog fragment documenting the behavior change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cardano-cli/src/Cardano/CLI/EraBased/Script/Read/Common.hs | Implements Dijkstra-era JSON simple-script support via upgradeTimelock instead of aborting. |
| .changes/20260827_121029_cardano-cli_palas_dijkstra_simple_scripts.yml | Changelog entry describing the new Dijkstra behavior for JSON simple scripts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jimbo4350
approved these changes
Aug 28, 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
Reading a simple script from a JSON file in the Dijkstra era aborted with an internal
TODO Dijkstraerror. The reader parses simple scripts in the shared Allegra timelock format and then converts to the era's script type; the Dijkstra arm was a stub.This PR fills it using
upgradeTimelock, the same conversion the api uses for this exact purpose.Today this path is not reachable from the command line: no Dijkstra command takes script files yet. That arrives in a later PR, and this stub has to be gone before it does, otherwise every Dijkstra command reading a simple script would crash.
How to trust this PR
Pretty much the same mechanism as for Conway, but using
Dijkstra.upgradeTimelock.Checklist
.changes/