Skip to content

Commit 2446e28

Browse files
authored
Merge pull request #5089 from IntersectMBO/ldan/move-era-defs
Move era definitions to `core:internal` Resolves #5069
2 parents 692959b + 811231c commit 2446e28

File tree

19 files changed

+96
-27
lines changed

19 files changed

+96
-27
lines changed

cabal.project

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ packages:
6565
program-options
6666
ghc-options: -Werror
6767

68+
if (impl(ghc >=9.8))
69+
program-options
70+
ghc-options:
71+
-Wwarn=x-unsafe-internal
72+
6873
package plutus-preprocessor
6974
haddock-options: "--optghc=-fplugin-opt PlutusTx.Plugin:defer-errors"
7075

eras/allegra/impl/cardano-ledger-allegra.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ library
6969
base >=4.18 && <5,
7070
bytestring,
7171
cardano-ledger-binary >=1.4,
72-
cardano-ledger-core >=1.17,
72+
cardano-ledger-core:{cardano-ledger-core, internal} >=1.17,
7373
cardano-ledger-shelley ^>=1.17,
7474
cardano-slotting,
7575
cardano-strict-containers,

eras/allegra/impl/src/Cardano/Ledger/Allegra/Era.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{-# LANGUAGE MultiParamTypeClasses #-}
55
{-# LANGUAGE TypeFamilies #-}
66
{-# LANGUAGE UndecidableInstances #-}
7+
{-# OPTIONS_GHC -Wno-orphans #-}
78

89
module Cardano.Ledger.Allegra.Era (
910
AllegraEra,
@@ -13,13 +14,11 @@ module Cardano.Ledger.Allegra.Era (
1314

1415
import Cardano.Ledger.Coin (Coin)
1516
import Cardano.Ledger.Genesis (EraGenesis, NoGenesis)
17+
import Cardano.Ledger.Internal.Era (AllegraEra)
1618
import Cardano.Ledger.Shelley (ShelleyEra)
1719
import Cardano.Ledger.Shelley.Core
1820
import Cardano.Ledger.Shelley.Rules
1921

20-
-- | The Allegra era
21-
data AllegraEra
22-
2322
instance Era AllegraEra where
2423
type PreviousEra AllegraEra = ShelleyEra
2524
type ProtVerLow AllegraEra = 3

eras/alonzo/impl/cardano-ledger-alonzo.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ library
8585
cardano-data ^>=1.2.1,
8686
cardano-ledger-allegra ^>=1.8,
8787
cardano-ledger-binary ^>=1.7,
88-
cardano-ledger-core ^>=1.18,
88+
cardano-ledger-core:{cardano-ledger-core, internal} ^>=1.18,
8989
cardano-ledger-mary ^>=1.9,
9090
cardano-ledger-shelley ^>=1.17,
9191
cardano-slotting,

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Era.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE TypeFamilies #-}
3+
{-# OPTIONS_GHC -Wno-orphans #-}
34

45
module Cardano.Ledger.Alonzo.Era (
56
AlonzoEra,
@@ -10,15 +11,13 @@ module Cardano.Ledger.Alonzo.Era (
1011
AlonzoLEDGER,
1112
) where
1213

14+
import Cardano.Ledger.Internal.Era (AlonzoEra)
1315
import Cardano.Ledger.Mary (MaryEra, MaryValue)
1416
import Cardano.Ledger.Shelley.Core
1517
import Cardano.Ledger.Shelley.Rules
1618

1719
-- =====================================================
1820

19-
-- | The Alonzo era
20-
data AlonzoEra
21-
2221
instance Era AlonzoEra where
2322
type PreviousEra AlonzoEra = MaryEra
2423
type ProtVerLow AlonzoEra = 5

eras/babbage/impl/cardano-ledger-babbage.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ library
8181
cardano-ledger-allegra ^>=1.8,
8282
cardano-ledger-alonzo ^>=1.14,
8383
cardano-ledger-binary >=1.6,
84-
cardano-ledger-core >=1.17,
84+
cardano-ledger-core:{cardano-ledger-core, internal} >=1.17,
8585
cardano-ledger-mary ^>=1.9,
8686
cardano-ledger-shelley ^>=1.17,
8787
cardano-strict-containers,

eras/babbage/impl/src/Cardano/Ledger/Babbage/Era.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE TypeFamilies #-}
3+
{-# OPTIONS_GHC -Wno-orphans #-}
34

45
module Cardano.Ledger.Babbage.Era (
56
BabbageEra,
@@ -13,6 +14,7 @@ import Cardano.Ledger.Alonzo (AlonzoEra)
1314
import Cardano.Ledger.Alonzo.Rules (AlonzoBBODY)
1415
import Cardano.Ledger.Core
1516
import Cardano.Ledger.Genesis (EraGenesis, NoGenesis)
17+
import Cardano.Ledger.Internal.Era (BabbageEra)
1618
import Cardano.Ledger.Mary.Value (MaryValue)
1719
import qualified Cardano.Ledger.Shelley.API as API
1820
import Cardano.Ledger.Shelley.Rules (
@@ -28,9 +30,6 @@ import Cardano.Ledger.Shelley.Rules (
2830

2931
-- =====================================================
3032

31-
-- | The Babbage era
32-
data BabbageEra
33-
3433
instance Era BabbageEra where
3534
type PreviousEra BabbageEra = AlonzoEra
3635
type ProtVerLow BabbageEra = 7

eras/conway/impl/cardano-ledger-conway.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ library
9898
cardano-ledger-alonzo ^>=1.14,
9999
cardano-ledger-babbage ^>=1.12,
100100
cardano-ledger-binary ^>=1.7,
101-
cardano-ledger-core ^>=1.18,
101+
cardano-ledger-core:{cardano-ledger-core, internal} ^>=1.18,
102102
cardano-ledger-mary ^>=1.9,
103103
cardano-ledger-shelley ^>=1.17,
104104
cardano-slotting,

eras/conway/impl/src/Cardano/Ledger/Conway/Era.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE TypeFamilies #-}
3+
{-# OPTIONS_GHC -Wno-orphans #-}
34

45
module Cardano.Ledger.Conway.Era (
56
ConwayEra,
@@ -24,6 +25,7 @@ module Cardano.Ledger.Conway.Era (
2425

2526
import Cardano.Ledger.Babbage (BabbageEra)
2627
import Cardano.Ledger.Core
28+
import Cardano.Ledger.Internal.Era (ConwayEra)
2729
import Cardano.Ledger.Mary.Value (MaryValue)
2830
import qualified Cardano.Ledger.Shelley.API as API
2931
import Cardano.Ledger.Shelley.Rules (
@@ -35,9 +37,6 @@ import Cardano.Ledger.Shelley.Rules (
3537

3638
-- =====================================================
3739

38-
-- | The Conway era
39-
data ConwayEra
40-
4140
instance Era ConwayEra where
4241
type PreviousEra ConwayEra = BabbageEra
4342
type ProtVerLow ConwayEra = 9

eras/mary/impl/cardano-ledger-mary.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ library
7979
cardano-data ^>=1.2,
8080
cardano-ledger-allegra ^>=1.8,
8181
cardano-ledger-binary >=1.4,
82-
cardano-ledger-core >=1.17,
82+
cardano-ledger-core:{cardano-ledger-core, internal} >=1.17,
8383
cardano-ledger-shelley ^>=1.17,
8484
cardano-strict-containers,
8585
containers,

0 commit comments

Comments
 (0)