Skip to content

Commit 4a0dccd

Browse files
cardano-api: 10.17
1 parent 0a7d6a3 commit 4a0dccd

File tree

28 files changed

+251
-335
lines changed

28 files changed

+251
-335
lines changed

cabal.project

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ test-show-details: direct
3030

3131
program-options
3232
ghc-options: -fwrite-ide-info
33+
34+
source-repository-package
35+
type: git
36+
location: https://github.com/locallycompact/cardano-api
37+
tag: 2b8c608c9be8d17cdf14565256a3b7d1e61817f0
38+
--sha256: sha256-vyhCsgzpvTexsaY2W/KU6aIL2RnGvEWbhRYOoh6P3QY=
39+
subdir:
40+
cardano-api

hydra-cardano-api/hydra-cardano-api.cabal

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ library
4040
hs-source-dirs: src
4141
ghc-options: -haddock
4242
exposed-modules:
43-
Cardano.Api.UTxO
4443
Hydra.Cardano.Api
4544
Hydra.Cardano.Api.Address
4645
Hydra.Cardano.Api.AddressInEra
47-
Hydra.Cardano.Api.BlockHeader
4846
Hydra.Cardano.Api.ChainPoint
4947
Hydra.Cardano.Api.ExecutionUnits
5048
Hydra.Cardano.Api.Hash
@@ -76,7 +74,7 @@ library
7674
, aeson >=2
7775
, base >=4.14
7876
, bytestring
79-
, cardano-api ^>=10.16
77+
, cardano-api ^>=10.17
8078
, cardano-api:gen
8179
, cardano-binary
8280
, cardano-crypto-class

hydra-cardano-api/src/Cardano/Api/UTxO.hs

Lines changed: 0 additions & 153 deletions
This file was deleted.

hydra-cardano-api/src/Hydra/Cardano/Api.hs

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ module Hydra.Cardano.Api (
2323
-- * Wrapped Types
2424
module Hydra.Cardano.Api,
2525

26-
-- ** UTxO
27-
UTxO,
28-
UTxO' (UTxO),
29-
3026
-- * Extras
3127
module Extras,
3228

@@ -38,9 +34,10 @@ import Cardano.Api as X hiding (
3834
AddressInEra (..),
3935
AddressTypeInEra (..),
4036
BalancedTxBody (..),
41-
Key (..),
42-
KeyWitness,
37+
KeyWitness (..),
4338
PlutusScript,
39+
PlutusScriptSerialised,
40+
ReferenceScript (..),
4441
Script (..),
4542
ScriptInEra (..),
4643
ScriptLanguage (..),
@@ -85,42 +82,15 @@ import Cardano.Api as X hiding (
8582
import Cardano.Api.Ledger as X (
8683
PParams,
8784
)
88-
import Cardano.Api.Shelley as X (
89-
AcquiringFailure (..),
90-
Hash (HeaderHash),
91-
Key (..),
92-
PlutusScriptOrReferenceInput (PScript),
93-
PoolId,
94-
ShelleyGenesis (..),
95-
ShelleyLedgerEra,
96-
SigningKey (..),
97-
StakeCredential (..),
98-
VerificationKey (..),
99-
fromAlonzoCostModels,
100-
fromAlonzoPrices,
101-
fromPlutusData,
102-
fromShelleyMetadata,
103-
toAlonzoPrices,
104-
toPlutusData,
105-
toShelleyMetadata,
106-
toShelleyNetwork,
107-
)
108-
import Cardano.Api.UTxO (
109-
UTxO,
110-
UTxO' (..),
111-
)
112-
import Cardano.Ledger.Coin as X (Coin (..))
11385
import Hydra.Cardano.Api.Prelude (
11486
Era,
11587
LedgerEra,
116-
LedgerProtocolParameters,
11788
Map,
11889
ledgerEraVersion,
11990
)
12091

12192
import Hydra.Cardano.Api.Address ()
12293
import Hydra.Cardano.Api.AddressInEra as Extras
123-
import Hydra.Cardano.Api.BlockHeader as Extras
12494
import Hydra.Cardano.Api.ChainPoint as Extras
12595
import Hydra.Cardano.Api.ExecutionUnits as Extras
12696
import Hydra.Cardano.Api.Hash as Extras
@@ -145,8 +115,6 @@ import Hydra.Cardano.Api.Value as Extras
145115
import Hydra.Cardano.Api.Witness as Extras
146116

147117
import Cardano.Api qualified
148-
import Cardano.Api.Internal.Tx.Body (TxInsReferenceDatums)
149-
import Cardano.Api.Shelley qualified
150118
import Cardano.Ledger.Alonzo.TxAuxData qualified as Ledger
151119
import Cardano.Ledger.Alonzo.TxWits qualified as Ledger
152120
import Cardano.Ledger.BaseTypes as X (Network)
@@ -212,17 +180,17 @@ type KeyWitness = Cardano.Api.KeyWitness Era
212180

213181
pattern ShelleyBootstrapWitness :: Ledger.BootstrapWitness -> KeyWitness
214182
pattern ShelleyBootstrapWitness{shelleyBootstrapWitness} <-
215-
Cardano.Api.Shelley.ShelleyBootstrapWitness _ shelleyBootstrapWitness
183+
Cardano.Api.ShelleyBootstrapWitness _ shelleyBootstrapWitness
216184
where
217185
ShelleyBootstrapWitness =
218-
Cardano.Api.Shelley.ShelleyBootstrapWitness shelleyBasedEra
186+
Cardano.Api.ShelleyBootstrapWitness shelleyBasedEra
219187

220188
pattern ShelleyKeyWitness :: Ledger.WitVKey 'Ledger.Witness -> KeyWitness
221189
pattern ShelleyKeyWitness{shelleyKeyWitness} <-
222-
Cardano.Api.Shelley.ShelleyKeyWitness _ shelleyKeyWitness
190+
Cardano.Api.ShelleyKeyWitness _ shelleyKeyWitness
223191
where
224192
ShelleyKeyWitness =
225-
Cardano.Api.Shelley.ShelleyKeyWitness shelleyBasedEra
193+
Cardano.Api.ShelleyKeyWitness shelleyBasedEra
226194

227195
-- ** PlutusScript
228196

@@ -231,10 +199,10 @@ type PlutusScript = Cardano.Api.PlutusScript PlutusScriptV3
231199

232200
pattern PlutusScriptSerialised :: ShortByteString -> PlutusScript
233201
pattern PlutusScriptSerialised{plutusScriptSerialised} <-
234-
Cardano.Api.Shelley.PlutusScriptSerialised plutusScriptSerialised
202+
Cardano.Api.PlutusScriptSerialised plutusScriptSerialised
235203
where
236204
PlutusScriptSerialised =
237-
Cardano.Api.Shelley.PlutusScriptSerialised
205+
Cardano.Api.PlutusScriptSerialised
238206

239207
-- ** Script
240208

@@ -243,10 +211,10 @@ type Script = Cardano.Api.Script PlutusScriptV3
243211

244212
pattern PlutusScript :: PlutusScript -> Script
245213
pattern PlutusScript{plutusScript} <-
246-
Cardano.Api.Shelley.PlutusScript _ plutusScript
214+
Cardano.Api.PlutusScript _ plutusScript
247215
where
248216
PlutusScript =
249-
Cardano.Api.Shelley.PlutusScript PlutusScriptV3
217+
Cardano.Api.PlutusScript PlutusScriptV3
250218

251219
-- ** ScriptInEra
252220

@@ -259,10 +227,10 @@ type ScriptLanguage = Cardano.Api.ScriptLanguage PlutusScriptV3
259227

260228
pattern PlutusScriptLanguage :: ScriptLanguage
261229
pattern PlutusScriptLanguage <-
262-
Cardano.Api.Shelley.PlutusScriptLanguage _
230+
Cardano.Api.PlutusScriptLanguage _
263231
where
264232
PlutusScriptLanguage =
265-
Cardano.Api.Shelley.PlutusScriptLanguage PlutusScriptV3
233+
Cardano.Api.PlutusScriptLanguage PlutusScriptV3
266234

267235
-- ** ScriptWitness
268236

@@ -322,7 +290,7 @@ pattern ShelleyTxBody
322290
, txBodyAuxiliaryData
323291
, txBodyScriptValidity
324292
} <-
325-
Cardano.Api.Shelley.ShelleyTxBody
293+
Cardano.Api.ShelleyTxBody
326294
_
327295
txBodyLedgerTxBody
328296
txBodyScripts
@@ -331,7 +299,7 @@ pattern ShelleyTxBody
331299
txBodyScriptValidity
332300
where
333301
ShelleyTxBody =
334-
Cardano.Api.Shelley.ShelleyTxBody shelleyBasedEra
302+
Cardano.Api.ShelleyTxBody shelleyBasedEra
335303

336304
signShelleyTransaction :: TxBody -> [ShelleyWitnessSigningKey] -> Tx
337305
signShelleyTransaction = Cardano.Api.signShelleyTransaction shelleyBasedEra
@@ -600,25 +568,25 @@ pattern TxOut{txOutAddress, txOutValue, txOutDatum, txOutReferenceScript} <-
600568

601569
-- ** ReferenceScript
602570

603-
type ReferenceScript = Cardano.Api.Shelley.ReferenceScript Era
571+
type ReferenceScript = Cardano.Api.ReferenceScript Era
604572
{-# COMPLETE ReferenceScript, ReferenceScriptNone #-}
605573

606574
pattern ReferenceScript :: ScriptInAnyLang -> ReferenceScript
607575
pattern ReferenceScript{referenceScript} <-
608-
Cardano.Api.Shelley.ReferenceScript
576+
Cardano.Api.ReferenceScript
609577
_
610578
referenceScript
611579
where
612580
ReferenceScript =
613-
Cardano.Api.Shelley.ReferenceScript
581+
Cardano.Api.ReferenceScript
614582
babbageBasedEra
615583

616-
pattern ReferenceScriptNone :: Cardano.Api.Shelley.ReferenceScript Era
584+
pattern ReferenceScriptNone :: Cardano.Api.ReferenceScript Era
617585
pattern ReferenceScriptNone <-
618-
Cardano.Api.Shelley.ReferenceScriptNone
586+
Cardano.Api.ReferenceScriptNone
619587
where
620588
ReferenceScriptNone =
621-
Cardano.Api.Shelley.ReferenceScriptNone
589+
Cardano.Api.ReferenceScriptNone
622590

623591
-- ** TxOutDatum
624592

@@ -729,3 +697,15 @@ pattern ScriptWitness scriptWitnessInCtx scriptWitness <-
729697

730698
makeShelleyKeyWitness :: TxBody -> ShelleyWitnessSigningKey -> KeyWitness
731699
makeShelleyKeyWitness = Cardano.Api.makeShelleyKeyWitness shelleyBasedEra
700+
701+
type UTxO = Cardano.Api.UTxO Era
702+
703+
{-# COMPLETE UTxO #-}
704+
pattern UTxO ::
705+
Map TxIn (TxOut CtxUTxO) ->
706+
UTxO
707+
pattern UTxO{utxo} <-
708+
Cardano.Api.UTxO utxo
709+
where
710+
UTxO =
711+
Cardano.Api.UTxO

0 commit comments

Comments
 (0)