Skip to content

Move EraBasedProtocolParametersUpdate to Cardano.Api.Compatible.ProtocolParametersUpdate - #1336

Open
Jimbo4350 wants to merge 1 commit into
masterfrom
jordan/move-era-based-pparams-update
Open

Move EraBasedProtocolParametersUpdate to Cardano.Api.Compatible.ProtocolParametersUpdate#1336
Jimbo4350 wants to merge 1 commit into
masterfrom
jordan/move-era-based-pparams-update

Conversation

@Jimbo4350

@Jimbo4350 Jimbo4350 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Changelog

- description: |
    Move `EraBasedProtocolParametersUpdate`, its era-sliced record types and the pre-Conway `UpdateProposal` machinery into a new module `Cardano.Api.Compatible.ProtocolParametersUpdate`. `Cardano.Api.ProtocolParameters` re-exports it, so its export list is unchanged.
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
   - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...
# uncomment at least one main project this PR is associated with
  projects:
   - cardano-api
  # - cardano-api-gen
  # - cardano-rpc
  # - cardano-wasm

Context

Follow-up to #1335 (stacked on it). Moves the era-based update-proposal machinery out of Cardano.Api.ProtocolParameters into Cardano.Api.Compatible.ProtocolParametersUpdate: EraBasedProtocolParametersUpdate, its era-sliced records, createEraBasedProtocolParamUpdate, createPParams, UpdateProposal and its to/fromLedger* conversions. The UpdateProposal cluster must move with the GADT: it contains it, and the GADT's FromCBOR instance depends on fromLedgerPParamsUpdate, which uses the private slice helpers.

Cardano.Api.ProtocolParameters re-exports the new module, so its export list and Cardano.Api are unchanged. Cardano.Api.Compatible re-exports it too.

How to trust this PR

  • Pure code motion plus import/export plumbing; no function bodies changed.
  • The export list of Cardano.Api.ProtocolParameters is identical to master.
  • cabal build cardano-api --enable-tests is clean under -Werror.

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

🤖 Generated with Claude Code

{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
…colParametersUpdate

Relocates the era-based protocol parameter update GADT, its era-sliced
record types, createEraBasedProtocolParamUpdate, createPParams and the
pre-Conway UpdateProposal machinery into a new Compatible module. The
UpdateProposal cluster has to move with the GADT: UpdateProposal contains
it, and its FromCBOR instance depends on fromLedgerPParamsUpdate, which in
turn uses the private pparamsUpdateTo* helpers.

Cardano.Api.ProtocolParameters re-exports the new module, so its export
list and Cardano.Api are unchanged. Cardano.Api.Compatible re-exports the
new module as well.
@Jimbo4350
Jimbo4350 force-pushed the jordan/move-era-based-pparams-update branch from 302fc0d to 1f1acd6 Compare September 10, 2026 17:58
Base automatically changed from jordan/remove-protocol-parameters to master September 10, 2026 18:37
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.

2 participants