Skip to content

Support Dijkstra simple scripts read from JSON - #1427

Merged
palas merged 2 commits into
masterfrom
support-dijkstra-simple-scripts
Aug 28, 2026
Merged

Support Dijkstra simple scripts read from JSON#1427
palas merged 2 commits into
masterfrom
support-dijkstra-simple-scripts

Conversation

@palas

@palas palas commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Context

Reading a simple script from a JSON file in the Dijkstra era aborted with an internal TODO Dijkstra error. 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

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

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>
Comment thread cardano-cli/src/Cardano/CLI/EraBased/Script/Read/Common.hs Outdated
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.
Copilot AI lite review requested due to automatic review settings August 28, 2026 12:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.upgradeTimelock when 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.

@palas
palas added this pull request to the merge queue Aug 28, 2026
Base automatically changed from derive-accepted-witness-eras to master August 28, 2026 17:59
Merged via the queue into master with commit 43ea07d Aug 28, 2026
26 checks passed
@palas
palas deleted the support-dijkstra-simple-scripts branch August 28, 2026 18:04
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