Skip to content

Export fromLedgerTxValidityLowerBound and fromLedgerTxValidityUpperBound#1118

Open
Jimbo4350 wants to merge 2 commits intomasterfrom
export-fromLedgerTxValidity-bounds
Open

Export fromLedgerTxValidityLowerBound and fromLedgerTxValidityUpperBound#1118
Jimbo4350 wants to merge 2 commits intomasterfrom
export-fromLedgerTxValidity-bounds

Conversation

@Jimbo4350
Copy link
Contributor

@Jimbo4350 Jimbo4350 commented Mar 4, 2026

Changelog

- description: |
    Export `fromLedgerTxValidityLowerBound` and `fromLedgerTxValidityUpperBound`.
  type:
   - compatible     # the API has changed but is non-breaking
  projects:
   - cardano-api

Context

Originally requested in PR #892 by @locallycompact. @carbolymer pointed out that these functions already exist internally and just need to be exported. This PR does that, following the same export pattern as fromLedgerTxOuts.

How to trust this PR

No new code — just adds two existing internal functions to the export lists of Cardano.Api.Tx.Internal.Body and Cardano.Api.Tx.

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

These functions already exist internally in Cardano.Api.Tx.Internal.Body
but were not exported. Export them from both the Internal module and the
Cardano.Api.Tx re-export module, following the same pattern as
fromLedgerTxOuts.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Exports two existing internal helpers that convert ledger validity interval bounds so downstream users can access them via the public Cardano.Api.Tx module.

Changes:

  • Export fromLedgerTxValidityLowerBound and fromLedgerTxValidityUpperBound from Cardano.Api.Tx.Internal.Body
  • Re-export the same functions from Cardano.Api.Tx
  • Document the change in cardano-api’s changelog

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cardano-api/src/Cardano/Api/Tx/Internal/Body.hs Adds the two validity-bound helpers to the module export list
cardano-api/src/Cardano/Api/Tx.hs Re-exports the two helpers from the public Tx module
cardano-api/CHANGELOG.md Notes the new exports as a compatible change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +6
- Export `fromLedgerTxValidityLowerBound` and `fromLedgerTxValidityUpperBound` from
`Cardano.Api.Tx.Internal.Body`
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

Since the PR summary says these functions are exported from Cardano.Api.Tx.Internal.Body and re-exported from Cardano.Api.Tx, the changelog entry should mention the public re-export as that’s what downstream consumers will most likely use. Consider updating the entry to explicitly say they’re now available from Cardano.Api.Tx (and/or both modules).

Suggested change
- Export `fromLedgerTxValidityLowerBound` and `fromLedgerTxValidityUpperBound` from
`Cardano.Api.Tx.Internal.Body`
- Make `fromLedgerTxValidityLowerBound` and `fromLedgerTxValidityUpperBound` available from
`Cardano.Api.Tx` (re-exported from `Cardano.Api.Tx.Internal.Body`)

Copilot uses AI. Check for mistakes.
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