Skip to content

Commit

Permalink
Add public module Cardano.Write.Eras
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Oct 17, 2024
1 parent d214485 commit f628e28
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/balance-tx/cardano-balance-tx.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ library
build-depends:
, cardano-balance-tx:internal
exposed-modules:
Cardano.Write.Eras
Cardano.Write.Tx

library internal
Expand Down
57 changes: 57 additions & 0 deletions lib/balance-tx/lib/main/Cardano/Write/Eras.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
-- |
-- Copyright: © 2024 Cardano Foundation
-- License: Apache-2.0
--
module Cardano.Write.Eras
(
-- * Eras
Babbage
, Conway

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

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

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

import Cardano.Ledger.Api
( Babbage
, Conway
)
import Internal.Cardano.Write.Eras
( AnyRecentEra (..)
, CardanoApi.ShelleyLedgerEra
, CardanoApiEra
, IsRecentEra (..)
, LatestLedgerEra
, MaybeInRecentEra (..)
, RecentEra (..)
, RecentEraConstraints
, allRecentEras
, cardanoEra
, cardanoEraFromRecentEra
, fromAnyCardanoEra
, fromRecentEra
, shelleyBasedEra
, shelleyBasedEraFromRecentEra
, toAnyCardanoEra
, toRecentEra
)
6 changes: 3 additions & 3 deletions lib/network-layer/src/Cardano/Wallet/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ import Cardano.Wallet.Primitive.Types.StakePoolSummary
import Cardano.Wallet.Primitive.Types.Tx.SealedTx
( SealedTx
)
import Cardano.Write.Eras
( MaybeInRecentEra
)
import Control.Monad.Trans.Except
( ExceptT (..)
)
Expand All @@ -96,9 +99,6 @@ import Data.Text.Class
import GHC.Generics
( Generic
)
import Internal.Cardano.Write.Tx
( MaybeInRecentEra
)

import qualified Cardano.Wallet.Read as Read
import qualified Data.Text as T
Expand Down

0 comments on commit f628e28

Please sign in to comment.