Refactor and modernise DRep golden tests for thread-safety#1209
Closed
newhoggy wants to merge 4 commits into
Closed
Refactor and modernise DRep golden tests for thread-safety#1209newhoggy wants to merge 4 commits into
DRep golden tests for thread-safety#1209newhoggy wants to merge 4 commits into
Conversation
carbolymer
reviewed
Jun 2, 2025
| -- @cabal test cardano-cli-golden --test-options '-p "/golden governance drep id hash/"'@ | ||
| hprop_golden_governance_drep_id_hash :: Property | ||
| hprop_golden_governance_drep_id_hash = | ||
| watchdogProp . propertyOnce $ do |
Contributor
There was a problem hiding this comment.
I think we should keep watchdogs everywhere.
Contributor
Author
There was a problem hiding this comment.
We will need to write a new watchdog for the new test api. I wanted to see it hang in one of these property test first before adding it.
8baf41b to
8d3138d
Compare
Jimbo4350
requested changes
Jun 2, 2025
Contributor
Jimbo4350
left a comment
There was a problem hiding this comment.
I'm not convinced this refactor is necessary. Let's explore other options.
|
This PR is stale because it has been open 45 days with no activity. |
|
This issue was closed because it has been stalled for 60 days with no activity. |
3 tasks
Jimbo4350
added a commit
that referenced
this pull request
May 14, 2026
Adapt to cardano-api PR #1209, which removes the legacy 'TxOut CtxTx era' from the Compatible and Experimental APIs: * 'createCompatibleTx' now takes '[Exp.TxOut (ShelleyLedgerEra era)]' plus a new 'Map L.DataHash (L.Data ...)' argument carrying any supplemental datum bodies. The legacy 'TxOut CtxTx era' bundled supplemental datums inside outputs; 'Exp.TxOut' only carries the datum hash, so callers thread the full datum bodies in explicitly. * The bridge helpers 'fromLegacyTxOut', 'legacyDatumToDatum', 'supplementalDatumFromLegacy', 'toLedgerDatum', and the 'DatumDecodingError' type are deleted from 'Cardano.Api.Experimental.Tx'. Migration: * 'mkTxOut' and 'toTxOutInAnyEra' now return '(Exp.TxOut (ShelleyLedgerEra era), Map DataHash (L.Data ...))' directly, building the legacy 'TxOut CtxTx era' internally only as a stepping stone for 'toShelleyTxOutAny'. * 'createCompatibleTx' call site in 'Compatible/Transaction/Run.hs' folds the per-output supplemental datums via 'Map.unions' and passes them as the new argument. * 'toTxOutInEra' and 'toTxOutInShelleyBasedEra' in 'EraBased/Transaction/Run.hs' delegate directly to 'mkTxOut' (the deleted 'fromLegacyTxOut' is gone). * 'TxCmdDatumDecodingError' is removed since the underlying 'Exp.DatumDecodingError' is gone and the new conversion is total. Temporary 'cabal.project' additions (to be removed once #1209 is merged and the next cardano-api is published to CHaP): * 'source-repository-package' pointing at the PR branch so CI can build against the unpublished API. * Per-package '-Wwarn=deprecations -Wwarn=unused-imports' for cardano-cli. The PR branch is several commits ahead of cardano-api-11.1.0.0 and surfaces unrelated TxBody/TxBodyContent deprecations (cardano-api PR #1200) plus a redundant 'Cardano.Ledger.Core' import in 'Cardano.CLI.Read' that became visible after upstream re-exports widened. Both are separate cleanups out of scope for this PR.
This was referenced May 18, 2026
Jimbo4350
added a commit
that referenced
this pull request
May 19, 2026
Adapt to cardano-api PR #1209, which removes the legacy 'TxOut CtxTx era' from the Compatible and Experimental APIs: * 'createCompatibleTx' now takes '[Exp.TxOut (ShelleyLedgerEra era)]' plus a new 'Map L.DataHash (L.Data ...)' argument carrying any supplemental datum bodies. The legacy 'TxOut CtxTx era' bundled supplemental datums inside outputs; 'Exp.TxOut' only carries the datum hash, so callers thread the full datum bodies in explicitly. * The bridge helpers 'fromLegacyTxOut', 'legacyDatumToDatum', 'supplementalDatumFromLegacy', 'toLedgerDatum', and the 'DatumDecodingError' type are deleted from 'Cardano.Api.Experimental.Tx'. Migration: * 'mkTxOut' and 'toTxOutInAnyEra' now return '(Exp.TxOut (ShelleyLedgerEra era), Map DataHash (L.Data ...))' directly, building the legacy 'TxOut CtxTx era' internally only as a stepping stone for 'toShelleyTxOutAny'. * 'createCompatibleTx' call site in 'Compatible/Transaction/Run.hs' folds the per-output supplemental datums via 'Map.unions' and passes them as the new argument. * 'toTxOutInEra' and 'toTxOutInShelleyBasedEra' in 'EraBased/Transaction/Run.hs' delegate directly to 'mkTxOut' (the deleted 'fromLegacyTxOut' is gone). * 'TxCmdDatumDecodingError' is removed since the underlying 'Exp.DatumDecodingError' is gone and the new conversion is total. Temporary 'cabal.project' additions (to be removed once #1209 is merged and the next cardano-api is published to CHaP): * 'source-repository-package' pointing at the PR branch so CI can build against the unpublished API. * Per-package '-Wwarn=deprecations -Wwarn=unused-imports' for cardano-cli. The PR branch is several commits ahead of cardano-api-11.1.0.0 and surfaces unrelated TxBody/TxBodyContent deprecations (cardano-api PR #1200) plus a redundant 'Cardano.Ledger.Core' import in 'Cardano.CLI.Read' that became visible after upstream re-exports widened. Both are separate cleanups out of scope for this PR.
Jimbo4350
added a commit
that referenced
this pull request
May 19, 2026
cardano-api 11.2.0.0 is published to CHaP. Bump the cardano-haskell-packages index-state past the publish (2026-05-18T18:23:40Z), bump the cardano-cli cabal dep from ^>=11.1 to ^>=11.2, and bump the CHaP flake input accordingly. 11.2.0.0 introduces breaking changes that subsequent commits in this PR migrate cardano-cli to: legacy TxOut removed (cardano-api #1209), legacy Certificate type removed (#1210), and TxBody/TxBodyContent deprecated (#1200).
Jimbo4350
added a commit
that referenced
this pull request
May 19, 2026
Adapt to cardano-api PR #1209, which removes the legacy 'TxOut CtxTx era' from the Compatible and Experimental APIs: * 'createCompatibleTx' now takes '[Exp.TxOut (ShelleyLedgerEra era)]' plus a new 'Map L.DataHash (L.Data ...)' argument carrying any supplemental datum bodies. The legacy 'TxOut CtxTx era' bundled supplemental datums inside outputs; 'Exp.TxOut' only carries the datum hash, so callers thread the full datum bodies in explicitly. * The bridge helpers 'fromLegacyTxOut', 'legacyDatumToDatum', 'supplementalDatumFromLegacy', 'toLedgerDatum', and the 'DatumDecodingError' type are deleted from 'Cardano.Api.Experimental.Tx'. Migration: * 'mkTxOut' and 'toTxOutInAnyEra' now return '(Exp.TxOut (ShelleyLedgerEra era), Map DataHash (L.Data ...))' directly, building the legacy 'TxOut CtxTx era' internally only as a stepping stone for 'toShelleyTxOutAny'. * 'createCompatibleTx' call site in 'Compatible/Transaction/Run.hs' folds the per-output supplemental datums via 'Map.unions' and passes them as the new argument. * 'toTxOutInEra' and 'toTxOutInShelleyBasedEra' in 'EraBased/Transaction/Run.hs' delegate directly to 'mkTxOut' (the deleted 'fromLegacyTxOut' is gone). * 'TxCmdDatumDecodingError' is removed since the underlying 'Exp.DatumDecodingError' is gone and the new conversion is total.
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.
Changelog
Context
This PR improves the structure and exception safety of golden tests related to
DRepgovernance features by:UnitIOstyle enabled byHedgehog.Extras.Test.New.Monadfromhedgehog-extras, which simplifies composition and improves readability.serveFilesWhileto two new modules:Test.Cardano.CLI.Network(used in traditional test code)Test.Cardano.CLI.New.Network(uses MonadMask, preferred in the new-style tests)Dependency Update
Updates the
hedgehog-extrasdependency, for the new support for theUnitIOabstraction and new test monads.Benefits
UnitIO.MonadMask.How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist