Skip to content

Commit ab6fc23

Browse files
authored
Merge pull request #748 from IntersectMBO/merge-internal-lib
Merge `cardano-api:internal` with `cardano-api` main library under `Cardano.Api.Internal.*` and export required symbols
2 parents 8b5f077 + 8e1c59b commit ab6fc23

File tree

203 files changed

+1009
-1029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+1009
-1029
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
e28fadbebc18b87991f84af72d8611393ae8875a
22
b76f949e815990545371530a466b16f691a3aa98
33
73fd9122f78282b1db7f6884b3bc23fb29f3e67f
4+
7634a9e8235050a55e5e3022a22a550aa3ade06e

cardano-api/cardano-api.cabal

Lines changed: 117 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -51,114 +51,49 @@ common text
5151
else
5252
build-depends: text >=2.0
5353

54-
library internal
54+
library
5555
import: project-config, maybe-unix, maybe-Win32, text
56-
visibility: public
57-
hs-source-dirs: internal
56+
hs-source-dirs:
57+
src
58+
5859
-- Do not expose any additional modules. The correct way
5960
-- to expose new functionality is via Cardano.Api or
6061
-- Cardano.Api.Shelley
6162
exposed-modules:
62-
Cardano.Api.Address
63-
Cardano.Api.Anchor
64-
Cardano.Api.Block
65-
Cardano.Api.Certificate
66-
Cardano.Api.Convenience.Construction
67-
Cardano.Api.Convenience.Query
68-
Cardano.Api.DRepMetadata
69-
Cardano.Api.DeserialiseAnyOf
70-
Cardano.Api.Eon.AllegraEraOnwards
71-
Cardano.Api.Eon.AlonzoEraOnwards
72-
Cardano.Api.Eon.BabbageEraOnwards
73-
Cardano.Api.Eon.ByronToAlonzoEra
74-
Cardano.Api.Eon.Convert
75-
Cardano.Api.Eon.ConwayEraOnwards
76-
Cardano.Api.Eon.MaryEraOnwards
77-
Cardano.Api.Eon.ShelleyBasedEra
78-
Cardano.Api.Eon.ShelleyEraOnly
79-
Cardano.Api.Eon.ShelleyToAllegraEra
80-
Cardano.Api.Eon.ShelleyToAlonzoEra
81-
Cardano.Api.Eon.ShelleyToBabbageEra
82-
Cardano.Api.Eon.ShelleyToMaryEra
83-
Cardano.Api.Eras
84-
Cardano.Api.Eras.Case
85-
Cardano.Api.Eras.Core
86-
Cardano.Api.Error
87-
Cardano.Api.Experimental.Eras
88-
Cardano.Api.Experimental.Tx
89-
Cardano.Api.Feature
90-
Cardano.Api.Fees
91-
Cardano.Api.Genesis
92-
Cardano.Api.GenesisParameters
93-
Cardano.Api.Governance.Actions.ProposalProcedure
94-
Cardano.Api.Governance.Actions.VotingProcedure
95-
Cardano.Api.Governance.Metadata.DrepRegistration
96-
Cardano.Api.Governance.Metadata.GovAction
97-
Cardano.Api.Governance.Metadata.Parsers
98-
Cardano.Api.Governance.Metadata.Validation
99-
Cardano.Api.Governance.Poll
100-
Cardano.Api.HasTypeProxy
101-
Cardano.Api.Hash
102-
Cardano.Api.IO
103-
Cardano.Api.IO.Base
104-
Cardano.Api.IO.Compat
105-
Cardano.Api.IO.Compat.Posix
106-
Cardano.Api.IO.Compat.Win32
107-
Cardano.Api.IPC
108-
Cardano.Api.IPC.Monad
109-
Cardano.Api.IPC.Version
110-
Cardano.Api.InMode
111-
Cardano.Api.Json
112-
Cardano.Api.Keys.Byron
113-
Cardano.Api.Keys.Class
114-
Cardano.Api.Keys.Praos
115-
Cardano.Api.Keys.Read
116-
Cardano.Api.Keys.Shelley
63+
Cardano.Api
64+
Cardano.Api.Byron
65+
Cardano.Api.ChainSync.Client
66+
Cardano.Api.ChainSync.ClientPipelined
67+
Cardano.Api.Compatible
68+
Cardano.Api.Consensus
69+
Cardano.Api.Crypto.Ed25519Bip32
70+
Cardano.Api.Experimental
71+
Cardano.Api.Internal.Address
72+
Cardano.Api.Internal.Block
73+
Cardano.Api.Internal.DRepMetadata
74+
Cardano.Api.Internal.Eon.ShelleyBasedEra
75+
Cardano.Api.Internal.Eras
76+
Cardano.Api.Internal.Error
77+
Cardano.Api.Internal.Fees
78+
Cardano.Api.Internal.Genesis
79+
Cardano.Api.Internal.GenesisParameters
80+
Cardano.Api.Internal.Governance.Metadata.Validation
81+
Cardano.Api.Internal.IO
82+
Cardano.Api.Internal.LedgerState
83+
Cardano.Api.Internal.Modes
84+
Cardano.Api.Internal.Orphans
85+
Cardano.Api.Internal.Plutus
86+
Cardano.Api.Internal.Pretty
87+
Cardano.Api.Internal.ProtocolParameters
88+
Cardano.Api.Internal.Query
89+
Cardano.Api.Internal.Script
90+
Cardano.Api.Internal.SerialiseLedgerCddl
91+
Cardano.Api.Internal.SerialiseTextEnvelope
92+
Cardano.Api.Internal.Tx.Sign
93+
Cardano.Api.Ledger
11794
Cardano.Api.Ledger.Lens
118-
Cardano.Api.LedgerEvents.ConvertLedgerEvent
119-
Cardano.Api.LedgerEvents.LedgerEvent
120-
Cardano.Api.LedgerEvents.Rule.BBODY.DELEGS
121-
Cardano.Api.LedgerEvents.Rule.BBODY.LEDGER
122-
Cardano.Api.LedgerEvents.Rule.BBODY.UTXOW
123-
Cardano.Api.LedgerEvents.Rule.TICK.NEWEPOCH
124-
Cardano.Api.LedgerEvents.Rule.TICK.RUPD
125-
Cardano.Api.LedgerState
126-
Cardano.Api.Modes
127-
Cardano.Api.Monad.Error
128-
Cardano.Api.NetworkId
129-
Cardano.Api.OperationalCertificate
130-
Cardano.Api.Orphans
131-
Cardano.Api.Plutus
132-
Cardano.Api.Pretty
133-
Cardano.Api.Protocol
134-
Cardano.Api.ProtocolParameters
135-
Cardano.Api.Query
136-
Cardano.Api.Query.Expr
137-
Cardano.Api.Query.Types
138-
Cardano.Api.ReexposeConsensus
139-
Cardano.Api.ReexposeLedger
140-
Cardano.Api.ReexposeNetwork
141-
Cardano.Api.Rewards
142-
Cardano.Api.Script
143-
Cardano.Api.ScriptData
144-
Cardano.Api.SerialiseBech32
145-
Cardano.Api.SerialiseCBOR
146-
Cardano.Api.SerialiseJSON
147-
Cardano.Api.SerialiseLedgerCddl
148-
Cardano.Api.SerialiseRaw
149-
Cardano.Api.SerialiseTextEnvelope
150-
Cardano.Api.SerialiseUsing
151-
Cardano.Api.SpecialByron
152-
Cardano.Api.StakePoolMetadata
153-
Cardano.Api.Tx.Body
154-
Cardano.Api.Tx.Compatible
155-
Cardano.Api.Tx.Sign
156-
Cardano.Api.TxIn
157-
Cardano.Api.TxMetadata
158-
Cardano.Api.Utils
159-
Cardano.Api.Value
160-
Cardano.Api.ValueParser
161-
Cardano.Api.Via.ShowOf
95+
Cardano.Api.Network
96+
Cardano.Api.Shelley
16297

16398
build-depends:
16499
FailT,
@@ -191,6 +126,7 @@ library internal
191126
cborg,
192127
containers,
193128
contra-tracer,
129+
cryptonite,
194130
data-default-class,
195131
deepseq,
196132
directory,
@@ -206,6 +142,7 @@ library internal
206142
mtl,
207143
network,
208144
network-mux,
145+
nothunks,
209146
ordered-containers,
210147
ouroboros-consensus ^>=0.22,
211148
ouroboros-consensus-cardano ^>=0.21,
@@ -235,40 +172,84 @@ library internal
235172
vector,
236173
yaml,
237174

238-
library
239-
import: project-config
240-
hs-source-dirs: src
241-
-- Do not expose any additional modules. The correct way
242-
-- to expose new functionality is via Cardano.Api or
243-
-- Cardano.Api.Shelley
244-
exposed-modules:
245-
Cardano.Api
246-
Cardano.Api.Byron
247-
Cardano.Api.ChainSync.Client
248-
Cardano.Api.ChainSync.ClientPipelined
249-
Cardano.Api.Compatible
250-
Cardano.Api.Consensus
251-
Cardano.Api.Crypto.Ed25519Bip32
252-
Cardano.Api.Experimental
253-
Cardano.Api.Ledger
254-
Cardano.Api.Network
255-
Cardano.Api.Shelley
256-
257-
reexported-modules: Cardano.Api.Ledger.Lens
258-
build-depends:
259-
bytestring,
260-
cardano-api:internal,
261-
cardano-binary,
262-
cardano-crypto,
263-
cardano-crypto-class ^>=2.1.2,
264-
cardano-ledger-byron,
265-
cryptonite,
266-
deepseq,
267-
memory,
268-
nothunks,
269-
ouroboros-network,
270-
ouroboros-network-protocols,
271-
typed-protocols,
175+
other-modules:
176+
Cardano.Api.Internal.Anchor
177+
Cardano.Api.Internal.Certificate
178+
Cardano.Api.Internal.Convenience.Construction
179+
Cardano.Api.Internal.Convenience.Query
180+
Cardano.Api.Internal.DeserialiseAnyOf
181+
Cardano.Api.Internal.Eon.AllegraEraOnwards
182+
Cardano.Api.Internal.Eon.AlonzoEraOnwards
183+
Cardano.Api.Internal.Eon.BabbageEraOnwards
184+
Cardano.Api.Internal.Eon.ByronToAlonzoEra
185+
Cardano.Api.Internal.Eon.Convert
186+
Cardano.Api.Internal.Eon.ConwayEraOnwards
187+
Cardano.Api.Internal.Eon.MaryEraOnwards
188+
Cardano.Api.Internal.Eon.ShelleyEraOnly
189+
Cardano.Api.Internal.Eon.ShelleyToAllegraEra
190+
Cardano.Api.Internal.Eon.ShelleyToAlonzoEra
191+
Cardano.Api.Internal.Eon.ShelleyToBabbageEra
192+
Cardano.Api.Internal.Eon.ShelleyToMaryEra
193+
Cardano.Api.Internal.Eras.Case
194+
Cardano.Api.Internal.Eras.Core
195+
Cardano.Api.Internal.Experimental.Eras
196+
Cardano.Api.Internal.Experimental.Tx
197+
Cardano.Api.Internal.Feature
198+
Cardano.Api.Internal.Governance.Actions.ProposalProcedure
199+
Cardano.Api.Internal.Governance.Actions.VotingProcedure
200+
Cardano.Api.Internal.Governance.Metadata.DrepRegistration
201+
Cardano.Api.Internal.Governance.Metadata.GovAction
202+
Cardano.Api.Internal.Governance.Metadata.Parsers
203+
Cardano.Api.Internal.Governance.Poll
204+
Cardano.Api.Internal.HasTypeProxy
205+
Cardano.Api.Internal.Hash
206+
Cardano.Api.Internal.IO.Base
207+
Cardano.Api.Internal.IO.Compat
208+
Cardano.Api.Internal.IO.Compat.Posix
209+
Cardano.Api.Internal.IO.Compat.Win32
210+
Cardano.Api.Internal.IPC
211+
Cardano.Api.Internal.IPC.Monad
212+
Cardano.Api.Internal.IPC.Version
213+
Cardano.Api.Internal.InMode
214+
Cardano.Api.Internal.Json
215+
Cardano.Api.Internal.Keys.Byron
216+
Cardano.Api.Internal.Keys.Class
217+
Cardano.Api.Internal.Keys.Praos
218+
Cardano.Api.Internal.Keys.Read
219+
Cardano.Api.Internal.Keys.Shelley
220+
Cardano.Api.Internal.LedgerEvents.ConvertLedgerEvent
221+
Cardano.Api.Internal.LedgerEvents.LedgerEvent
222+
Cardano.Api.Internal.LedgerEvents.Rule.BBODY.DELEGS
223+
Cardano.Api.Internal.LedgerEvents.Rule.BBODY.LEDGER
224+
Cardano.Api.Internal.LedgerEvents.Rule.BBODY.UTXOW
225+
Cardano.Api.Internal.LedgerEvents.Rule.TICK.NEWEPOCH
226+
Cardano.Api.Internal.LedgerEvents.Rule.TICK.RUPD
227+
Cardano.Api.Internal.Monad.Error
228+
Cardano.Api.Internal.NetworkId
229+
Cardano.Api.Internal.OperationalCertificate
230+
Cardano.Api.Internal.Protocol
231+
Cardano.Api.Internal.Query.Expr
232+
Cardano.Api.Internal.Query.Types
233+
Cardano.Api.Internal.ReexposeConsensus
234+
Cardano.Api.Internal.ReexposeLedger
235+
Cardano.Api.Internal.ReexposeNetwork
236+
Cardano.Api.Internal.Rewards
237+
Cardano.Api.Internal.ScriptData
238+
Cardano.Api.Internal.SerialiseBech32
239+
Cardano.Api.Internal.SerialiseCBOR
240+
Cardano.Api.Internal.SerialiseJSON
241+
Cardano.Api.Internal.SerialiseRaw
242+
Cardano.Api.Internal.SerialiseUsing
243+
Cardano.Api.Internal.SpecialByron
244+
Cardano.Api.Internal.StakePoolMetadata
245+
Cardano.Api.Internal.Tx.Body
246+
Cardano.Api.Internal.Tx.Compatible
247+
Cardano.Api.Internal.TxIn
248+
Cardano.Api.Internal.TxMetadata
249+
Cardano.Api.Internal.Utils
250+
Cardano.Api.Internal.Value
251+
Cardano.Api.Internal.ValueParser
252+
Cardano.Api.Internal.Via.ShowOf
272253

273254
library gen
274255
import: project-config
@@ -294,7 +275,6 @@ library gen
294275
base16-bytestring,
295276
bytestring,
296277
cardano-api,
297-
cardano-api:internal,
298278
cardano-binary >=1.6 && <1.8,
299279
cardano-crypto-class ^>=2.1.2,
300280
cardano-crypto-test ^>=1.5,
@@ -325,7 +305,6 @@ test-suite cardano-api-test
325305
bytestring,
326306
cardano-api,
327307
cardano-api:gen,
328-
cardano-api:internal,
329308
cardano-binary,
330309
cardano-crypto,
331310
cardano-crypto-class ^>=2.1.2,
@@ -400,7 +379,6 @@ test-suite cardano-api-golden
400379
bytestring,
401380
cardano-api,
402381
cardano-api:gen,
403-
cardano-api:internal,
404382
cardano-binary,
405383
cardano-crypto-class ^>=2.1.2,
406384
cardano-data >=1.0,

cardano-api/gen/Test/Gen/Cardano/Api/ProtocolParameters.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Test.Gen.Cardano.Api.ProtocolParameters where
22

33
import Cardano.Api
4+
import Cardano.Api.Internal.ProtocolParameters
45
import Cardano.Api.Ledger
5-
import Cardano.Api.ProtocolParameters
66

77
import Test.Gen.Cardano.Api.Typed (genCostModels)
88

cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ import qualified Cardano.Api as Api
140140
import Cardano.Api.Byron (KeyWitness (ByronKeyWitness),
141141
WitnessNetworkIdOrByronAddress (..))
142142
import qualified Cardano.Api.Byron as Byron
143-
import Cardano.Api.Error
143+
import Cardano.Api.Internal.Error
144144
import qualified Cardano.Api.Ledger as L
145145
import qualified Cardano.Api.Ledger.Lens as A
146-
import Cardano.Api.Script (scriptInEraToRefScript)
146+
import Cardano.Api.Internal.Script (scriptInEraToRefScript)
147147
import Cardano.Api.Shelley
148148
import qualified Cardano.Api.Shelley as ShelleyApi
149149

@@ -1203,7 +1203,7 @@ genProtocolParameters era = do
12031203

12041204
pure ProtocolParameters{..}
12051205

1206-
-- | Generate valid protocol parameters which pass validations in Cardano.Api.ProtocolParameters
1206+
-- | Generate valid protocol parameters which pass validations in Cardano.Api.Internal.ProtocolParameters
12071207
genValidProtocolParameters :: ShelleyBasedEra era -> Gen (LedgerProtocolParameters era)
12081208
genValidProtocolParameters sbe = shelleyBasedEraTestConstraints sbe $ LedgerProtocolParameters <$> Q.arbitrary
12091209

cardano-api/gen/Test/Hedgehog/Golden/ErrorMessage.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
module Test.Hedgehog.Golden.ErrorMessage where
55

66
import Cardano.Api (Error (..))
7-
import Cardano.Api.Pretty
7+
import Cardano.Api.Internal.Pretty
88

99
import qualified Control.Concurrent.QSem as IO
1010
import Control.Exception (bracket_)

cardano-api/gen/Test/Hedgehog/Roundtrip/CBOR.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module Test.Hedgehog.Roundtrip.CBOR
1111
where
1212

1313
import Cardano.Api
14-
import Cardano.Api.Eon.ShelleyBasedEra
15-
import Cardano.Api.Script
14+
import Cardano.Api.Internal.Eon.ShelleyBasedEra
15+
import Cardano.Api.Internal.Script
1616

1717
import qualified Cardano.Ledger.Core as Ledger
1818
import qualified Cardano.Ledger.Plutus.Language as Plutus

0 commit comments

Comments
 (0)