Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADP-3344] Split off Cardano.Write.Eras #4809

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

HeinrichApfelmus
Copy link
Contributor

@HeinrichApfelmus HeinrichApfelmus commented Oct 17, 2024

This pull requests splits off a public module Cardano.Write.Eras for working with the notion of "recent era".

First, we split off an internal module, then we create a public module that re-exports the internal module.

Comments

  • In order to keep the scope of this pull request contained, I have not attempted to shrink the exported interface of Cardano.Write.Eras yet.

Issue Number

ADP-3344

@HeinrichApfelmus HeinrichApfelmus self-assigned this Oct 17, 2024
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3344/write-era branch 3 times, most recently from b513018 to ee6010b Compare October 17, 2024 17:29
@HeinrichApfelmus HeinrichApfelmus marked this pull request as ready for review October 17, 2024 17:33
@HeinrichApfelmus HeinrichApfelmus changed the title Split off Cardano.Write.Eras [ADP-3344] Split off Cardano.Write.Eras Oct 17, 2024
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3344/write-era branch 3 times, most recently from 84d286b to 16d3218 Compare October 17, 2024 17:56
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/ADP-3344/write-era branch from 16d3218 to b1110a5 Compare October 17, 2024 17:59
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

👌 thanks!

Comment on lines +5 to +55
module Cardano.Write.Eras
(
-- * Eras
BabbageEra
, ConwayEra

-- ** RecentEra
, RecentEra (..)
, IsRecentEra (..)
, CardanoApiEra
, toRecentEra
, fromRecentEra
, MaybeInRecentEra (..)
, LatestLedgerEra
, RecentEraConstraints
, allRecentEras

-- ** Existential wrapper
, AnyRecentEra (..)
, toAnyCardanoEra
, fromAnyCardanoEra

-- ** Helpers for cardano-api compatibility
, cardanoEra
, shelleyBasedEra
, ShelleyLedgerEra
, cardanoEraFromRecentEra
, shelleyBasedEraFromRecentEra
) where

import Internal.Cardano.Write.Eras
( AnyRecentEra (..)
, BabbageEra
, CardanoApiEra
, ConwayEra
, IsRecentEra (..)
, LatestLedgerEra
, MaybeInRecentEra (..)
, RecentEra (..)
, RecentEraConstraints
, ShelleyLedgerEra
, allRecentEras
, cardanoEra
, cardanoEraFromRecentEra
, fromAnyCardanoEra
, fromRecentEra
, shelleyBasedEra
, shelleyBasedEraFromRecentEra
, toAnyCardanoEra
, toRecentEra
)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not too fond of duplicating this interface (friction to change, risk of sections getting out of sync etc), but we can go with it for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The idea is that the public interface, that is Cardano.Write.Eras, is the source of truth that we need to curate, and that Internal.Cardano.Write.Eras is an internal module that we can arrange as we please, including removal. For the time being, I'd like to invest into curation and avoid upsetting the internal arrangement of balance-tx too much.

I think the original idea behind the :internal sublibrary was that the public library can choose not to export certain internals, such as constructors for abstract data types, but that these internals are still available when unit testing the internal library.

Copy link
Member

@Anviking Anviking Oct 17, 2024

Choose a reason for hiding this comment

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

For the time being, I'd like to invest into curation and avoid upsetting the internal arrangement of balance-tx too much.

👍

@HeinrichApfelmus HeinrichApfelmus added this pull request to the merge queue Oct 17, 2024
Merged via the queue into master with commit f258291 Oct 17, 2024
25 checks passed
@HeinrichApfelmus HeinrichApfelmus deleted the HeinrichApfelmus/ADP-3344/write-era branch October 17, 2024 21:24
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